{"_id":"@neoswap/solana","_rev":"330-d20828c799e581e03d7d8b1c93af9a99","name":"@neoswap/solana","description":"NPM package for NeoSwap test","dist-tags":{"betaProd":"0.3.0-beta93","beta":"0.3.20-beta3","latest":"0.3.26"},"versions":{"0.0.1":{"name":"@neoswap/solana","version":"0.0.1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.1","maintainers":[{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"050327d7b71581e14484b67e5fb5280d49ec3bf3","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.1.tgz","fileCount":154,"integrity":"sha512-Mabw0GQt+oxxg/PNaYkQWhEGIcXRLM+sPHMNi/AwpuPIZQONvB+zUJuF7EggwTwGQ3DHMljSebdmjS+/vRqyrA==","signatures":[{"sig":"MEQCIGOaZCbVVKSXE8AB2M3mWq45zagQBoYbNMu+jgsQon61AiAIQafwYV4AfQgFZ8HYOtHTck9zvCItWsLlH/0tLVjwaA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":660164},"main":"./lib/es5/index.js","types":"./lib/es5/index.d.ts","module":"./lib/es6/index.js","gitHead":"14bff9a76f79e7b6a77a669cad1873cba7c003d2","_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.1_1688544463785_0.6392424103215824","host":"s3://npm-registry-packages"}},"0.0.2":{"name":"@neoswap/solana","version":"0.0.2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.2","maintainers":[{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"24b985a576d9783322bcb21a3ce403085cd0cdf2","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.2.tgz","fileCount":154,"integrity":"sha512-e3xjW1O4nDxe638EF7g/p0LI01wzn0NATewxcF5N47uxQIlNmGzybSMrQPcwxD9F0H+oBH6RjCH/pSRGme8JCw==","signatures":[{"sig":"MEYCIQDCPdfNMxR0xuMZmEPDs2wh7aFdLS5ePrMu/qrjcoTXwwIhAM0wmrfuZE+KeBEZLzVyijrM07gaNZBYZSdLfax/Dq79","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":661808},"main":"./lib/es5/index.js","types":"./lib/es5/index.d.ts","module":"./lib/es6/index.js","gitHead":"0a22b09de353b643975b06fa08c12f00d87dc293","_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.2_1688549748838_0.8083547388607821","host":"s3://npm-registry-packages"}},"0.0.3":{"name":"@neoswap/solana","version":"0.0.3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"556faad49491c81eab79fbb66b1eec76438567f0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.3.tgz","fileCount":154,"integrity":"sha512-BKNfWDKYs4TuL8yALz9QFloopSXyryjWkhRNEA9Nb5OG9PKBHPUXF9yvXKsPEsojMTYC+FitYpqOAiH8HXn/Bg==","signatures":[{"sig":"MEQCIHYpUkPEPhBBT7kLRuhlXBRGBw7flKtP1u2n0HaHk4GuAiBtCJ6eXmwCJswD2E24hmh8EtfDtGXvqAlSLAciC6hhGg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":662257},"main":"./lib/es5/index.js","types":"./lib/es5/index.d.ts","module":"./lib/es6/index.js","gitHead":"0a22b09de353b643975b06fa08c12f00d87dc293","_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.3_1688561062852_0.8770551591484674","host":"s3://npm-registry-packages"}},"0.0.4":{"name":"@neoswap/solana","version":"0.0.4","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.4","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"0dfc7da1b55d74b2455145fba3f8750f6b30c00a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.4.tgz","fileCount":154,"integrity":"sha512-W6m/e7Js1z52w/CQy5Zow//kub7ydUm9DVo1gGwUKODNPAZC8yCD+J6rW3XnRYSs5i4lncoKRH9ZV8g4snuXzg==","signatures":[{"sig":"MEUCIQCS1QOXUVCBPQ8A9vhNiiw9x57oNPHhq9aP3KYXevBOvwIgKpPvmh9vkabdIyLnqApRPoFEUEyQgrm9gyLD93tj6mE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":662875},"main":"./lib/es5/index.js","types":"./lib/es5/index.d.ts","module":"./lib/es6/index.js","gitHead":"a2b57442144ab4c4c088dfff6000c520fec6972b","_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.4_1688566206065_0.3945158773934214","host":"s3://npm-registry-packages"}},"0.0.5":{"name":"@neoswap/solana","version":"0.0.5","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.5","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"3b17a978072626dcfecc255d6ef869e47d317949","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.5.tgz","fileCount":155,"integrity":"sha512-VcNRqMs84fbQTYg++X2LcujDOCt7XEXd5suChpfsVM2sIfkUsrPoC/PsqeDAv07GjAWl8AGpGvDZ6/dLuUIX/g==","signatures":[{"sig":"MEUCIQDLnmrsMZMoOf0zhF9oGtRx59fCgtvNUBLyH6iTyj5n+QIgZVoD1ymR/xsWjEC2kIoligAd8NYqLB/ZiyTMS3q83GY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":663975},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"56da08a63b9f3c50c6aa083ca95a55f3b28eff51","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.5_1688575537313_0.2838945008249576","host":"s3://npm-registry-packages"}},"0.0.6":{"name":"@neoswap/solana","version":"0.0.6","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.6","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"06cdc23c783acd8cf8b4261c503eabe22bfc08e4","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.6.tgz","fileCount":155,"integrity":"sha512-hZBbPVXdda1PTE/YMr6P1GMzmCXEvrQZE3aTzMHe5SqOa0p/Y+brPywCBdIVsv8zAyrFMNs9nL9TI+/4NRNN5w==","signatures":[{"sig":"MEYCIQCdD0QMeWiAdyUnF77/xd08LJAZf/ovgSZWozEU/wv/1AIhAIqJ7cgICzy7fV/RiehqKYP2RYELnJZt6B61Z5fQA7aO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":663947},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"56da08a63b9f3c50c6aa083ca95a55f3b28eff51","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.6_1688575645663_0.12805918356078183","host":"s3://npm-registry-packages"}},"0.0.8":{"name":"@neoswap/solana","version":"0.0.8","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.8","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"0772ae98223836e07ec306268b6492d7279a7d93","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.8.tgz","fileCount":155,"integrity":"sha512-wftOY3b8kxYOt4/R3FF3O19p4/TMVHOYoDKW6FkpUU/YFD1gzwXaOCMHOGu9c/mTTQbmV2n1nZ67tQDLOFhl6w==","signatures":[{"sig":"MEUCIBqKSTfd/cHNV0sUUzK+SWVckhKVOdPnPnX5e5IZzC/IAiEA1llY1x4Dku/uQUFrCELkKY19QapFE4S4AvRvDyK5aig=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":663947},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"56da08a63b9f3c50c6aa083ca95a55f3b28eff51","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.8_1688580582702_0.9706099885756656","host":"s3://npm-registry-packages"}},"0.0.9":{"name":"@neoswap/solana","version":"0.0.9","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.9","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"a42cef3e73b26fc0ad0e3a7a9cc5a21169f5514a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.9.tgz","fileCount":155,"integrity":"sha512-FInYbK5xPY9SCm8xvDRGB3q06sMs0LXNIMlRCscgz2hfdgd43xOjaESVr2Vwru/jCbydgl+rUmbYuC4sAjlWvQ==","signatures":[{"sig":"MEUCIQCTXKN0UZ+hfceEHjOmsRGiyCKEIYQe1dwFB6oMHxY4kAIgCqWTGNcMwu6qq5lQl+W0d4HTixT//zsHhs8XMhwVXA0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":663917},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"56da08a63b9f3c50c6aa083ca95a55f3b28eff51","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.9_1688599383162_0.6307588953898959","host":"s3://npm-registry-packages"}},"0.0.10":{"name":"@neoswap/solana","version":"0.0.10","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.10","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"cd59d2ae6d86a06d2756d6bec988d1f5f181e12c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.10.tgz","fileCount":155,"integrity":"sha512-FH5ymgHBOQ9VmKU7ss9ohCuWXI8OPQcD4cAJtRw8pQnzcmbYX93k8mddoT7mDvDlFreUugweRttYr+2vOX453Q==","signatures":[{"sig":"MEQCIDbHMRQvAEKQEIqduQ761SiP56GYx5d9gPM2idXPXOwbAiA7Am0lQ/eoAlF69BddTbXsj03HTJRPs2pB501kT5dAXg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":663930},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"56da08a63b9f3c50c6aa083ca95a55f3b28eff51","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.10_1688601480597_0.7939550146524292","host":"s3://npm-registry-packages"}},"0.0.11":{"name":"@neoswap/solana","version":"0.0.11","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.11","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"74378d6ab7ee73e59186584573bba07e1ab74d25","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.11.tgz","fileCount":155,"integrity":"sha512-uZ0w9CBSk6vglrUL4x+yFu7/NVdRZdZaR8Bfu6LdqAXnRZvmSbSkJx4gJ4tudSLuztFCEEQmazxWyn4brSeBHg==","signatures":[{"sig":"MEUCIHCnB4Nv/+Or/2rY+pVaUPCVjSIcxCKCrbQWqrmgXoLQAiEAvZKO2ia6FbVSYbJ6zBrlFJHOLyQCHCUFGyiglvtYvgM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":664276},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"56da08a63b9f3c50c6aa083ca95a55f3b28eff51","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.11_1688603701516_0.2613975785595051","host":"s3://npm-registry-packages"}},"0.0.12":{"name":"@neoswap/solana","version":"0.0.12","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.12","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"4b6b1a88bdf9a1674d3c099c5c5ea62bd4c5a320","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.12.tgz","fileCount":155,"integrity":"sha512-ndUn48kyfAa/2RHDGMAIxKcjjz8P0JXCIjYsTpkDGFVjN16hOdPaNCaipKapaDdo0JSFVXy+T+LJ8V6Ml6cxmw==","signatures":[{"sig":"MEQCIHqqiTvzZgRfOkOl8D+MiAGhjgP80+OToVUhjdwLsNTDAiAE5dq+l9EzetROi4ksk37xmekfw0fl2r/vDV0zX+IaoA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":664516},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1a8853eeb3ca182bfb2593517cba151d7fdb471f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.12_1688629400755_0.7121303256252158","host":"s3://npm-registry-packages"}},"0.0.100":{"name":"@neoswap/solana","version":"0.0.100","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.100","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"4c5aca40508ebe9888f1a4fbc83d58152028e9e5","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.100.tgz","fileCount":87,"integrity":"sha512-9VCVvcfVTIgn+VxfyX7gATjH/WmkTezIpZcq6LRVtlLKDiZrDXwuVIQuOHTYIWGKReGxPc2g9j3CI8K3eo8rmg==","signatures":[{"sig":"MEUCIHUdJVSDKODzKAJuJrebPwZGH8xZU7bmrhUbcDtCYhwLAiEAl0Zl2HfSLMm+1aRoFYwesyhV4eciNFWyLKqd1WOT4Ro=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":337272},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.100_1688647402905_0.46444176496473544","host":"s3://npm-registry-packages"}},"0.0.101":{"name":"@neoswap/solana","version":"0.0.101","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.101","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"b6c10bee7a32f1383d1b5148f5ca02afe93e2b65","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.101.tgz","fileCount":87,"integrity":"sha512-TDorma9kJj8LtFsk8Bv0Kf9oj5duYnicxkKeVsOQQiCgS7tyy639nH/25ahozJszadJlkxffjhSqGFeUtIY8uw==","signatures":[{"sig":"MEUCIQCGZz59Wz2ansCNX2xYpShZOj2H3fVuvMWo5F74Cp4OnAIgZZQ7DReHAokvptY+5yiKbGo74LR1/bvM0JON5GUABzE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":336962},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.101_1688648091346_0.3534596771968104","host":"s3://npm-registry-packages"}},"0.0.102":{"name":"@neoswap/solana","version":"0.0.102","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.102","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"80f87274de62b6891b9f8c2c81b766c516753edb","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.102.tgz","fileCount":67,"integrity":"sha512-GWzlDaVnWcbNHsQPoNqJElXoAOndHCbAYhpXV1qLNoz6WRuOTvS1LRLz9s4U32zrD23qlhJx9k16QtitLYFqWQ==","signatures":[{"sig":"MEQCIDD2Puj/bdt7bIBTxcDDilfQv4YYbidKvQnX7cFfcLSoAiA+g+bM8tbolNvFFSudj1zOMGm5lVWWDRIe0FXotY6aBA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":247316},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.102_1688656029569_0.014670725429533737","host":"s3://npm-registry-packages"}},"0.0.103":{"name":"@neoswap/solana","version":"0.0.103","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.103","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"5c2bd61101c1f4e51b1c02a05671e39a067dd42c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.103.tgz","fileCount":67,"integrity":"sha512-ZEx9RPxqHyGjJl5hZbb1SdWmO9Q5t5959n2ZqgHQb0H4NaQjh3QQUP6imjXedpFpeIozydWIXXcEG2utLaWxXQ==","signatures":[{"sig":"MEYCIQCMa2xKAn7Dfb9qwBO35L4Wo2CoBqFgFjt2c8hx7Zy0SAIhANmpiEIgp0E0fwGGLtYtNTOC7LIC1d1qpnEi12gVQcwa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":247317},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.103_1688657030833_0.13493589596809863","host":"s3://npm-registry-packages"}},"0.0.104":{"name":"@neoswap/solana","version":"0.0.104","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.104","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"cd50e919a4a47e469bf680740b677042bfb57665","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.104.tgz","fileCount":67,"integrity":"sha512-EVotVvZqicMqF8fg+NI0uc/Cb3XJl5WcQlQuehQq5NAyMVgnueNpaytcKJgH+3BOStXcGU6WrN87GbiQK36z+w==","signatures":[{"sig":"MEYCIQDm5v72fCGxxVoSLJg64N+z+mvyfMreD2PtKRC/luMrqAIhAJNqAhxdId8jVdshBgQx7dkipg/k9j/CAQAuI0IKvBip","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242490},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.104_1688658082058_0.1750391346558664","host":"s3://npm-registry-packages"}},"0.0.105":{"name":"@neoswap/solana","version":"0.0.105","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.105","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"dc5975c69cb1719e60745b7ac91d66044e01c27e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.105.tgz","fileCount":67,"integrity":"sha512-sjzM+tFhraJraxr+g7xHlsF9ixLn65tiMuBlWrmjNqXOID53T1rBYmnECtHA9yBZ7ct8RRAji6YbEOFvo6b2OA==","signatures":[{"sig":"MEUCIQDv7IOzubdjB10YyLBLEkPUxhGi0Sg0ibVxUN8VGybZ1wIgTxHMnb9huoS8mcBBY6spKwUUYGj06UyE9SVZbN1LGW4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":242490},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.25.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.105_1688659253546_0.8399116324053242","host":"s3://npm-registry-packages"}},"0.0.106":{"name":"@neoswap/solana","version":"0.0.106","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.106","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"4244ff935a3b79b52a28656e0993708fe260c45e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.106.tgz","fileCount":71,"integrity":"sha512-6ez7Cdn1ZA/BQ4PNJRmaEE7oeuB4aaKcGVl41/msSFFfratVHjeSMhAJY79m7RWzEtFOiCpFsKc6ORjPMnHylw==","signatures":[{"sig":"MEQCIDapV6CD5msp87pPTjA4V5SVeQAljvNtDjkN3IRcO/GzAiBf1DXg22HkRCTx80notVeNc7OztAIYm2M5MiECt8HPug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250575},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.25.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.106_1688661142907_0.3698058242428055","host":"s3://npm-registry-packages"}},"0.0.107":{"name":"@neoswap/solana","version":"0.0.107","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.107","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"0f97994a45b9ba82d3d2d78028ced80e47be61a0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.107.tgz","fileCount":71,"integrity":"sha512-I8yqiD+LwfY+vA0RIN2b7wfAlpajdj+34JyY9AwRgTiJTJLcw9m1Y0c5rGwL6L0E9hXE6CyFKy5RRruupyj6Cg==","signatures":[{"sig":"MEUCIFdK8Q/CP4Oj5isFp6x58tukU5T6j6YY7Wy/5zn3TxzVAiEA/2rCT8lgx9pulGjqMIMzp/p/V65PUd3Teu5jVEdzKpU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250574},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.107_1688662188602_0.679864650324848","host":"s3://npm-registry-packages"}},"0.0.108":{"name":"@neoswap/solana","version":"0.0.108","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.108","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"01b185d2e9d2ebe3fab619023f50d5d08f87f80d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.108.tgz","fileCount":71,"integrity":"sha512-i6uKq9x/caui+nPC9xf+encf6Pg5lCEobzyKMvp3eqwWZ35nHIPv7yQ7Ef69nMQQhUhTWFVWCXIpWaxl1ekmzA==","signatures":[{"sig":"MEYCIQDOHowMNi7c3Kgf/sXUGzaJ1NMX/dHQPTUJn3L9MWzEKwIhAJlorVaXZO2PM341CxXTegbU1Vyph3HgmCNu9Xov+TZU","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250955},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.108_1688664970287_0.06312395686292449","host":"s3://npm-registry-packages"}},"0.0.109":{"name":"@neoswap/solana","version":"0.0.109","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.109","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"8de856bb01d666bf5693b02d73f1a4a8030f4a6d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.109.tgz","fileCount":71,"integrity":"sha512-mHVeHq5wrsRHZOGvCrGPL/BirRDKXXp1CE6zM/KGUvCIpof5q/POhbqMm2lPLWybWB51NIvroHX661An49Uslw==","signatures":[{"sig":"MEUCIG9dPlWAHUnNQ50VjqaRXJT76w/0fOnRu0X5BcGUF86nAiEAnPBKFhjldezw+rfXo5pW81+XWPz8cozm+3Zpu1b2LUY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250955},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.109_1688665482917_0.7241784083404408","host":"s3://npm-registry-packages"}},"0.0.110":{"name":"@neoswap/solana","version":"0.0.110","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.110","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"5ed6003213bc6ccd0ae2c9e3c1da6af9db634cf6","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.110.tgz","fileCount":71,"integrity":"sha512-Y3HstZacFbDX5srAKBqOlPfmkAPdm6aPOuiONR3kJhvqJiWOmFTrWAgMQ4Fv9jCGaUgK78aMi3oulGXbnJ2SBg==","signatures":[{"sig":"MEUCIQDVBteBrQGl4luPiJygj9iaBIAIAOIh49KUqK4uQDYRLgIgJa390mD70p9aPAPKBfanvlBH+YU6d8LMDqb6dDikOJs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250999},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.110_1688666725728_0.27050259699229473","host":"s3://npm-registry-packages"}},"0.0.111":{"name":"@neoswap/solana","version":"0.0.111","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.111","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"989ded12b05cdf810e195a1a8fdc192e7a788370","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.111.tgz","fileCount":71,"integrity":"sha512-+O9dtaKKFhq2LwkMWpRXYFstKIl4r/q/hiBKWEHaKx5MYAZBX9aqQJ/+6nekKeA15AWCrFnJWvx69RBLNiHEZg==","signatures":[{"sig":"MEYCIQDcqRDn+v3dJz7WW2PoQyQG3iIwpUiAHofaGIcMJqvXIgIhANYEShr7VQa0EcFG448JIYu4d/ESO9R7sd+ZDEHl7Euv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":249897},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.111_1688694579682_0.5386046474699304","host":"s3://npm-registry-packages"}},"0.0.112":{"name":"@neoswap/solana","version":"0.0.112","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.112","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"28da8ffbe1e1fe0d0f7014b422bf6a2a29229543","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.112.tgz","fileCount":71,"integrity":"sha512-PxHzQEL5Jkj+p++N4Rqs+7c3HkZ1435x9YfpGAxR/DpaABliko36cU2Zv7ls88IuVADGnaauz5CnZvCMCJRsrw==","signatures":[{"sig":"MEUCIQC+0afCZCAaF7UnZwoy6umbpsSD3UE/jiDFv3ESkB4TjQIgJEATAJPkSpl49UFyB/xDVCMbRHUNE7OrhR2V/pcOshc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":250180},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.112_1688695411883_0.3377490163493697","host":"s3://npm-registry-packages"}},"0.0.113":{"name":"@neoswap/solana","version":"0.0.113","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.113","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"df22dc9fd00b9ab3de168f858cfa6c5cb1444085","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.113.tgz","fileCount":75,"integrity":"sha512-oNwI5ZrsradaD6LwEeinJI2Jjz6KfLs59Bk3+MQwnl206/xXORKlson/QI+NHNCrIcVMJgUB/wrwVA9c1PGQcw==","signatures":[{"sig":"MEUCIQDNeeN15SXxyUmJTi4taqKvy3WDq2dDKHIZuk085xRAEgIgTyUPg4dCYcYqMT+o+g6jh4LVcUVbY3JeLqZoStMZ5Hg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261651},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.113_1688699807367_0.3137993572735558","host":"s3://npm-registry-packages"}},"0.0.114":{"name":"@neoswap/solana","version":"0.0.114","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.114","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"b06a925d00275f6e57cf41c5f2b469bda375a115","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.114.tgz","fileCount":75,"integrity":"sha512-KSBGZAg8fv/g/zql0A4DZut7UQ7WBGyeNiufYvNfVhGKsFvWxJTaUjwlDodzShWPo5bcpYRBbiclg+IzGWKkSQ==","signatures":[{"sig":"MEQCIEzaAEHpzR7MaW2eXGHYZHB+dof10idv0KGWteizixoEAiBFWYAjz+DiLgj5e+EtLIUwExdDxIYMBGbTuRTNSIcdPQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261868},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.114_1688700555232_0.3627213299847356","host":"s3://npm-registry-packages"}},"0.0.115":{"name":"@neoswap/solana","version":"0.0.115","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.115","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"e7f2491b720f80e0771fa5416688da8cbfbd1480","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.115.tgz","fileCount":75,"integrity":"sha512-t+p73fpfFb8kcJQu0xBsThX6PxEp8LdNw+N9AM5bg9xVJNFO9sLTNBaGndtWlIyKc6eI8tSyvUS1s17MTMFW1w==","signatures":[{"sig":"MEUCIDv3mcMpPzdKafsKfSUWAK2V3BVphfbTf/HcvutmNg9NAiEA+LbbIEiE8aPKhQpK7Apda9LtgeltdJCzg7leUReDNgI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":261893},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.115_1688702058182_0.15130345707117354","host":"s3://npm-registry-packages"}},"0.0.116":{"name":"@neoswap/solana","version":"0.0.116","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.116","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"1be5beaae20da87a0c2eb8c1c3548e242baa5ea0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.116.tgz","fileCount":75,"integrity":"sha512-8zgQ7TqziPim3fTdYRPQhLW4hOtULvQBEOnxK599XNh/2ihptMTR7IYMpHZKPFG7L5GRTCY+xTwAQCcZYNPtOw==","signatures":[{"sig":"MEYCIQC00mk+HqZ0vU5vk4Ezb1pd0Y4WwIFegCepDtdrR+GrdwIhAMVZcSHs0lksblYxP02avTfROh4IxtdOQXPkwn7DwcQI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":262037},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.116_1688702561432_0.5593174384347732","host":"s3://npm-registry-packages"}},"0.0.117":{"name":"@neoswap/solana","version":"0.0.117","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.117","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"7dfe8f921bb237d0913a4f5f1c188ad56069ee32","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.117.tgz","fileCount":76,"integrity":"sha512-bGANHRbOrA/Uv6/w4LJP2zS3iUAghcIfOInZ8knIOItwAiswGb3Fu9OK+MemVyThUzCEWCD4JKKxldiNEruIZQ==","signatures":[{"sig":"MEUCIQDeTltkEzCgqCMOzEPj2JbjoUUr0ohwXKHFsipOiH1c4wIgDLOplnl0i/tb9M8oQl9ULNnWNMNT6u7itWW7u8d1R/A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":272199},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.117_1688709191246_0.6535658224186149","host":"s3://npm-registry-packages"}},"0.0.118":{"name":"@neoswap/solana","version":"0.0.118","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.118","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"ef6e7ad25ac5804a234f869ad9dba7d2ce38cd8d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.118.tgz","fileCount":76,"integrity":"sha512-ExQW6vbL2mEiSEoHjPwQbkyBalm26a4uSAJI5n3qsqb1gO1p3RnWC4pE6rgQ5ObGVTJsOI3IprI45/KI2gk2OQ==","signatures":[{"sig":"MEUCIEvSvqe95AICOnbHGhjdJHwH4fteC0fEqK/IvKemB6x8AiEAz9EmGbRWWTV7ZFbXyBz/iq4LsX/58rapmmd3toLmnnE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":270652},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.118_1688709862561_0.5039525049214157","host":"s3://npm-registry-packages"}},"0.0.119":{"name":"@neoswap/solana","version":"0.0.119","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.119","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"15f9049a850a0fcd6a35a315a76f1757b63b48e3","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.119.tgz","fileCount":76,"integrity":"sha512-0qHmDmFMfKAK3yS+AHn5pBXQUNmtnV40yPs+VPtmQqKOPrlEefL52A5ZiJtIf2muziXJVBgBkt0jGdVfoPHSEw==","signatures":[{"sig":"MEYCIQCMzpydIY6eZtgEyYIA3M+MRlfE/HlVXS0FfBYTEsxdawIhAMNhTushoAoGSu4UYhbDvdUrEhx6ONPGAY9WNzAOTcZG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":270528},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.119_1688710328460_0.6025475140871426","host":"s3://npm-registry-packages"}},"0.0.120":{"name":"@neoswap/solana","version":"0.0.120","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.120","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"f126664d395cc39831d82e4f45ded9fb8455fc1d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.120.tgz","fileCount":76,"integrity":"sha512-hJ47cPkZGmrEuCGCzTOlYJi/MDrb7+CtesA/E/z1Wo4/QkDCCZ+9AOLGuRBRVZ4fGrlWC/4F8z3Q/XLn/d4aew==","signatures":[{"sig":"MEUCIHU/DKI0joDm6EsUbX8RJc0zxEOEJidKaPH05Deq/o8uAiEA6xU5arPp9D3MlTRU3lZggevlS+wucI0d6ps03IE/v0M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":270560},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.120_1688710524641_0.33443730023438256","host":"s3://npm-registry-packages"}},"0.0.121":{"name":"@neoswap/solana","version":"0.0.121","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.121","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"48ac2ecc2f770a44c9e3458eec668016e4c7952a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.121.tgz","fileCount":76,"integrity":"sha512-Mz6ZIKc7rfP3fxV4uS14qIKD6tZPkUNMr7bZdkmn49Lt69KItJqWuI3//NdBdBVpt8HqRM7jGiWBcAX5z160kw==","signatures":[{"sig":"MEQCIDYUdpQhr4iiWJ+h+XUMm8SUf7/6dvXomCl53+LmI0DSAiBA46BdAhr4ZYcra3R5P9aLDKJ4I5/DyC8WNK8URucaVw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":270569},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.121_1688710655764_0.8625123217413726","host":"s3://npm-registry-packages"}},"0.0.122":{"name":"@neoswap/solana","version":"0.0.122","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.122","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"1506a628b65ca5d76d3361b500bd3c00389d1ca1","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.122.tgz","fileCount":76,"integrity":"sha512-p6FKjkypENZS7NQAK9YSwe1vaNivgAE+O5l1CHAJTrtuhJ6VX49tZYlhqNwjScnFryFW2/6ymhxuezzW/qPNHw==","signatures":[{"sig":"MEQCIG2T3GTWhr52LTb0hul9pUf8jSaYwy2XaaBA9WGvhNzCAiB4REHIkPYuy28u/weh+5gQaBi9idsNp0eQG5eJ45ttgQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":270724},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.122_1688710805669_0.40852843039998854","host":"s3://npm-registry-packages"}},"0.0.123":{"name":"@neoswap/solana","version":"0.0.123","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.123","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"7ba1d66963112dae3695ec48b9b61c08f3955e78","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.123.tgz","fileCount":76,"integrity":"sha512-uM1UU2OgdJwq8Q0TvHxT/cowDn5zoMAhZIiZukF2WDz0MC14o+lkcXlaD/EklgziGwwsVCYUNYuUifVNuqXRdA==","signatures":[{"sig":"MEYCIQCeW4y7zQkDj/QbXnv/oJpKk9cZuJjF+Arhij3EldTH4wIhALZO5tKJS+bfZEVn3Qb4HQXAa4X4DLL3yWrlVnDDEqTn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":270672},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.123_1688710864039_0.6704420443136094","host":"s3://npm-registry-packages"}},"0.0.124":{"name":"@neoswap/solana","version":"0.0.124","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.124","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"01d3d9093434a922a23f0d371586cdd45fe00366","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.124.tgz","fileCount":76,"integrity":"sha512-3cQtAhTxeeq/9Bv7GQkZoeuz+YBTQ4LcL+9Y9aRarDGwUJbRdpjr2d/fWgVQcR4br5tdSI4SPbI7ELOIP8qEIw==","signatures":[{"sig":"MEQCIHVRrjM02cmCu5fpkOA0LOBXHRFt0FEEZ7nFpzsx6fEeAiBARiK0YedaoY4nvaS+NBIzB+wF/T8hYHttiP0y8YtrVQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":270683},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.124_1688710936738_0.39323714117961295","host":"s3://npm-registry-packages"}},"0.0.125":{"name":"@neoswap/solana","version":"0.0.125","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.125","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"e06852b3166c935a7195247d2fffe3bf73568bb9","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.125.tgz","fileCount":76,"integrity":"sha512-jSo2BrHwGdzQuKjzOqrnP1XmVN5v0ViunYxbZO8I/wL8uY84K9p8oqEiNonL+6tdGZpQ8+tRr2Y2b6/x1Lc20w==","signatures":[{"sig":"MEUCIDGjq8UX+laU3WEwqo0Y8bZ8dxPILZYNMissqid7HqaCAiEA+QYzUDeg6PnO4/NpY19Lm2XmS/bqJlSwaJqQVAQbM9o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":270728},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.125_1688710994939_0.9446050494059832","host":"s3://npm-registry-packages"}},"0.0.126":{"name":"@neoswap/solana","version":"0.0.126","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.126","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"3dfc6409e5b1cd18cc97757c6a7754c1b3d3ab5b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.126.tgz","fileCount":76,"integrity":"sha512-jRfMenOput1InE5TO/JZLbWy8EqFvjNNhMkVnCZj6IGHinocOZoKfP+gBR3C7SPqXU5aHPbGgx8f7zQHEDvYkg==","signatures":[{"sig":"MEQCIEJQQZUlhtfHfxq1qB0h9MV5pVHlQ9LpxiX2dTlAOKHDAiBkSVmFiyoQZw+0D+BiLlbpggZPz9SL0wNC3v229NnlRw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":271095},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.126_1688711192915_0.7158300783245879","host":"s3://npm-registry-packages"}},"0.0.127":{"name":"@neoswap/solana","version":"0.0.127","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.127","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"8e10d92cbb23f987deb24c4085baa7f8a1b5dd9c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.127.tgz","fileCount":76,"integrity":"sha512-DiT8W+IgXCLNJiJ9lVA3PRmSoF4BiJ37pJSQbXwWklcHNF3qjz6Zc4jrk5Geb3KVlagaklpkKy3DzNoYwGYhvA==","signatures":[{"sig":"MEUCIQC+k24HEVG86KM324ntvBmmndsKUU5KJAF0rcUzAJlrjAIgZDCzYbWzVjHhQouncFkkSmTtpmGKtfaNC5g3cqSpP/4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":271091},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.127_1688711305036_0.04986238671086607","host":"s3://npm-registry-packages"}},"0.0.128":{"name":"@neoswap/solana","version":"0.0.128","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.128","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"ee770464b0bbe9bb1177cf4d1357fca65c317aed","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.128.tgz","fileCount":72,"integrity":"sha512-iVxUpV3HbSDAcql5YfpHy3I5StCDlqzPupQoEcwK7viMWDpp66BPCfcfugCVFbdPdkqg6KONs4zTPhAN7MbuBA==","signatures":[{"sig":"MEUCIDdIsV97RZjFjiM/Id8edxruAknT+06Se4CbYpqSDU45AiEA/K2JEIXcZ7Ht1lZRpPe8fQ7rC/LJ3tB8BrOKSDALE34=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":259744},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.128_1688714840634_0.903236925762253","host":"s3://npm-registry-packages"}},"0.0.129":{"name":"@neoswap/solana","version":"0.0.129","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.129","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"8e7276974d1849d1699df9972dec170b89ff6826","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.129.tgz","fileCount":72,"integrity":"sha512-HfhHzsFIU0o3NL0scMS+LDFAixRyuPuvod+tyGf3H8apZMqRW5oEir8JOa/w3OCjnouiSfnhtFDcarncxoxwXg==","signatures":[{"sig":"MEQCIF7lRZFZ3jNlE3QcrxTuJGL9A2H/mP2EqcxhlxzxlVhTAiBWwcX5KCwc4lO3O0uPTj+KIeg0jJit86UeFQjVxPT3PQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":260010},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.129_1688715301976_0.5293702589500435","host":"s3://npm-registry-packages"}},"0.0.130":{"name":"@neoswap/solana","version":"0.0.130","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.130","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"ef467cd967953a471650e39f2bf92bce85ae89d3","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.130.tgz","fileCount":72,"integrity":"sha512-40HFA6SZ7mEBMrHFKF+7uC9+LKWWd196Y5L4T8di8Qb1pNhNeSb5osrx2NHoHkhGh2Fp0qtONCGPK82NZpttLA==","signatures":[{"sig":"MEYCIQD3C5lH8+GbO15dYIoKkmrAXJm3BAHW7woyV+aJozsDgQIhALDA8kRlgYsnEvVGRCReTfkQI36JHJqDo7lGF3MzOdNi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":263732},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.130_1688715526612_0.6960627517959934","host":"s3://npm-registry-packages"}},"0.0.131":{"name":"@neoswap/solana","version":"0.0.131","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.131","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"d8e74eb18020ce6c87c1af21f97fad44378e8cbb","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.131.tgz","fileCount":72,"integrity":"sha512-f+6TnFpr/Qc+46K9q/AZQIQSv3pQKv99wrjWGoSE7ER8junlwRn+yrrE8BjHAy433y7arC4F23cRsSUaj1VMDA==","signatures":[{"sig":"MEQCICqmXTsBxIJaVxtGGMUE7EY3plCX4tYAn1Q/uCvh5C6PAiBxcno8f/0k+jHJOA1ygE08pifs8AkkVgUkNTglKs9BNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":263929},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.131_1688715794896_0.6208573696557831","host":"s3://npm-registry-packages"}},"0.0.132":{"name":"@neoswap/solana","version":"0.0.132","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.132","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"33047f0d025bad615926392dc19b715c796779de","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.132.tgz","fileCount":72,"integrity":"sha512-NmVnbGPKsI1mI31gKf1mk2HyleC39AzHQ1fosD+RfIY+sgTtAU1/XenJeOqJwKlq5j7NbbN8uqV2TfCUJ7DAOg==","signatures":[{"sig":"MEUCIQC1SauuNvDgrH+/EqJJkJbuDVrdZ4ZKOwofpMgoLY5LEQIgSUKwqUdFxmMjbgN9JLuqk00+1w2/e+D9d/yB4SC1KvA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":264344},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.132_1688716629024_0.9751078973724454","host":"s3://npm-registry-packages"}},"0.0.133":{"name":"@neoswap/solana","version":"0.0.133","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.133","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"8cfcef958131a0ed34813fd16e53d48a89e8a09d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.133.tgz","fileCount":72,"integrity":"sha512-sa6mrv8gxM5/2DiAdotj9JUL1ziRxwXqvRonrYHDNld7DkPtvRGhnTPXCxw4e3coMSd/vMinW2o4cLswxccPrA==","signatures":[{"sig":"MEUCIFc/qhv3Wk02bsaqTqqDtQX6d442zM3y3BnoVB72b/TzAiEAvrGYYMvb1cf3UFMNstM5QY5S0uxRowA2vaXnvnLstLo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":264335},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.133_1688716674099_0.5830886555740555","host":"s3://npm-registry-packages"}},"0.0.134":{"name":"@neoswap/solana","version":"0.0.134","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.134","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"1810b182a91d4b7c5b3a2c48bd1cf1c867a3ef01","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.134.tgz","fileCount":72,"integrity":"sha512-Gs6LpvBigzrj8Y+rgbD8tRJGdYtycL8rkuocJQ+mj+UbB1KEsKqVc+f7LueAJ53M0NdiiRFNqU38DYG8Q2mxYA==","signatures":[{"sig":"MEQCIFLRWGnoLirdhdQsXJrqE5k/zlQJw5mK2VfBQOfavjhhAiAwVGoajoe0jG4/YjZCH8pcp6XYGcNYv3/dK0lMiCgkug==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":264353},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.134_1688716735741_0.3300646395610778","host":"s3://npm-registry-packages"}},"0.0.135":{"name":"@neoswap/solana","version":"0.0.135","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.135","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"65155402808a8f9d4699b72345d718de9b7e9ac1","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.135.tgz","fileCount":72,"integrity":"sha512-PdbvrIOo5XK5mWuoLUEhYJ5Pp13ZKit+BtEb/7W7VMkhVrAC02S6PSd0BGJL13rD7Sk+86bfxkVuFT2XNoL04A==","signatures":[{"sig":"MEUCICAGsyobayflqqtUe/2q0aD0QPHMBvQallSMY1yrRAjlAiEApLT5z9Z9Tz37LVikdoHVyPFEf9tTIlGbXc6aS6a7yYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":264291},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.135_1688716799833_0.8748130137883245","host":"s3://npm-registry-packages"}},"0.0.136":{"name":"@neoswap/solana","version":"0.0.136","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.136","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"dd30642eb489821926234066919313f08693cdac","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.136.tgz","fileCount":72,"integrity":"sha512-CxJ5QcoxngS5uIeY5nZSeNrSB56IiVcI5jUuExYQtPrJpY3NKQBEfRaPUtCYQUqqp5YFrgYECQh3P347ZpBIHg==","signatures":[{"sig":"MEQCIF7ZnLdoeh508zweT9nQ/MvIJm/shnDH0dDk9KPIpf8WAiBBTXV4JeJexqVBM4zlmQTeGvM+gFAyMlWncXLh0Aam7Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":264374},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.136_1688716936500_0.8464876294002781","host":"s3://npm-registry-packages"}},"0.0.137":{"name":"@neoswap/solana","version":"0.0.137","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.137","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"81755e3d1808e18a25ec7a2cdceb919fda74b899","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.137.tgz","fileCount":72,"integrity":"sha512-OzQMqxDemd6F62XRcz+4fZ2xkc1sLWDSHT3rAnkktbaNzsQkzQA10iCv9UfeRxDsJ4aRyR6m3DFnn8BgUQDa7g==","signatures":[{"sig":"MEUCICBqI7mjmnbToGL5QegH8/0UnNxP8qIKTvTyiaZcAu6vAiEA47XvTFQOzWkD6TJ1AAFBn5ZnVZt8E4OLPt6Nlbmay0c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":264371},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.137_1688717033549_0.2097682314840672","host":"s3://npm-registry-packages"}},"0.1.0":{"name":"@neoswap/solana","version":"0.1.0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.1.0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"9bc83cc52a031b440e894256b92523759052fca9","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.1.0.tgz","fileCount":72,"integrity":"sha512-0Rtt6lJr/Gf15Cjw3OliMAjEt4LTmB3uBefLbz+S7o3z80gFYGQikju3/y6bzcAbfFs2jG/uoILo2sr4kfTDIw==","signatures":[{"sig":"MEUCIC+ODZdZbnUuQY5jver2D8jzvcGZrUPje6X2lhOooGD0AiEAzH7kKozvojfieVTYkK/eTZmV7bgoqZM/ZWqBZx4f8tU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":264369},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cf3ae3e4114f9050a927815e60e5d8fcedad0f15","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.1.0_1688717281281_0.10041660849176748","host":"s3://npm-registry-packages"}},"0.0.13":{"name":"@neoswap/solana","version":"0.0.13","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.13","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"e001d77b464682e58d0e510d4cd46430673c48fd","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.13.tgz","fileCount":155,"integrity":"sha512-J1OuBaQxUQLOSZTQihq6v4/rvn8T9nqEgjCqHktZOhmD6s/CUIm3K8XIaEINln1NEkrML6lGxUXprdOuQX2AbA==","signatures":[{"sig":"MEYCIQCvQgEABIAmFDDVO8aj7zJ1vIReeL1f2iZfqx3DkvM4XgIhALrSL12z/1bPy8oE8daaoq89dfokC2WkCJhg2hGiRMe6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":665669},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.13_1689248174496_0.7987841572438208","host":"s3://npm-registry-packages"}},"0.0.14":{"name":"@neoswap/solana","version":"0.0.14","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.14","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"523ae3e16b5bbaf0c89380c76e89f7a65ba394f5","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.14.tgz","fileCount":155,"integrity":"sha512-Kp3wD3gOSMb2izyfgG6pIG4YyR42z6mJKbRgcPbuWh0RR+ymwEEOHhendRbD6I5Z154djgz+9ASmIoxwKHsBcw==","signatures":[{"sig":"MEUCIED48IRQU99VwQo0tX2Kfeg6yfDrZ4xjCdz4zXSBCb0oAiEAjMRcVpCxSGI/hHEacVTE5hqbJXqSoTwFsFG5m+84chg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":664734},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.14_1689249573957_0.11527546477335449","host":"s3://npm-registry-packages"}},"0.0.15":{"name":"@neoswap/solana","version":"0.0.15","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.15","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"56be4d73148f51a035b56a4fcfd7d280ea5b0bc5","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.15.tgz","fileCount":155,"integrity":"sha512-ys4Br4Fm8WqxtDs7oPeUnHhjZHmZjUOb2HpWuGGvkvJr6BmGk/4S4e08tJYPXAVESrQoOg1AV0nHSAoBSatJ6A==","signatures":[{"sig":"MEUCIQD5afum8ytpRrKy2F2c+GYwhnXL9qgsggNu6OPmcy1KmwIgLygueR7JBE5F1vVTHcbhlDcIBqfqYqyzpCcWud5fPdA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":664348},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.15_1689251623520_0.8290306369517102","host":"s3://npm-registry-packages"}},"0.0.16":{"name":"@neoswap/solana","version":"0.0.16","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.16","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"3890b0dec1e6caa5e6c2ba0691cb1537de473313","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.16.tgz","fileCount":155,"integrity":"sha512-Y1DUVDo8SgTjOPvWxGSmPCOf3tp0lAH1Ck/fYz3FJz6y0lX4DcQJJ1/Y29V+1g15CPkrcY/TUaJ2qxWAqO81OA==","signatures":[{"sig":"MEYCIQDyyxkPb5x2wXI231JI9X0ZZ6vGRRQKrpW9NqlvpX582QIhALMkDDZ4JhHTBR2bK7Lq/zUMC5eKGEuTpB0kA9yXhDMj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":664628},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.16_1689251896615_0.3451316001082827","host":"s3://npm-registry-packages"}},"0.0.17":{"name":"@neoswap/solana","version":"0.0.17","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.17","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"3892eac7089eb2265f9cdcb19857a0c303edda8e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.17.tgz","fileCount":155,"integrity":"sha512-N24VMAthXVvF0XKo/2KiiKVUjuG3jI0FCFjfwmEbc6qVY5IfoPTxtP4lgS64UhaHxX1SadiIobjD54XDZWe6pg==","signatures":[{"sig":"MEUCIFeyqJmElB/YIh4Ee1bjycMizQsHBUP9PdYR/E5zwk5ZAiEAkMhpk+lthGDElot/RXWMshmC6r7m801S28IjPmiVtRU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":664896},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.17_1689253779915_0.13770158940019228","host":"s3://npm-registry-packages"}},"0.0.18":{"name":"@neoswap/solana","version":"0.0.18","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.18","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"9099e1e782b26b1175a12764b8ebf1fb73a067dd","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.18.tgz","fileCount":155,"integrity":"sha512-HA2i/vCqI3auBb1F0c1O4948myYTh3Aocw2RW9EnKSOPZsjDfPjQlXuppoAO6iEuZAKTaiFH+v4h5cs3oVpx3Q==","signatures":[{"sig":"MEUCICsNYzwbrTiHtmnSpBb88Bz22qPBXA8+O4l4T9RQJsXXAiEAt3fcJgi3aCXTDb6kEuxBfAcXwu6v0Jk/nt3y6OhzLRU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":664982},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.18_1689254540865_0.3631643002462679","host":"s3://npm-registry-packages"}},"0.0.19":{"name":"@neoswap/solana","version":"0.0.19","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.19","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"59238a4c42e17b9bc6226992041845c560e0b887","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.19.tgz","fileCount":155,"integrity":"sha512-DWoVBlg90hfQobCOfxSIbiAy7PvF1OHbpwHMp8kwGF2WbYN6wzozUvEUg75JXvqbQETTLH/lprQbj5zGRb4OqQ==","signatures":[{"sig":"MEYCIQDdbeV8qYoYCrjSf993mK0GffDsSyg/zRIqXVskUIEgwwIhAJNvCgBGjz32fjlYhV1xXNs19oHLVBXI9p5HmP7rjPfA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":664990},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.19_1689261081767_0.04319876061670125","host":"s3://npm-registry-packages"}},"0.0.20":{"name":"@neoswap/solana","version":"0.0.20","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.20","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"9f519d783e5128b8fa626b3cc11bf8d42ef0fbc9","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.20.tgz","fileCount":155,"integrity":"sha512-4QLbFgIV9aEbecnSce79HRyoGBOxpa9lDOfetpGuBcjh+9sxSnFqj9H2JXhc9ks21jEdv4LEGyUtWp4NFnds/w==","signatures":[{"sig":"MEUCIQCCM7O5NNStx4YEVFE1SF1xOaGKM+XtLf4aXaek3ut7FwIgRKK+mFYrFbZBxn4DnrtHZ1h31KI+pDuKA0reG5RN14k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":665002},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.20_1689269107563_0.8972229167179886","host":"s3://npm-registry-packages"}},"0.0.21":{"name":"@neoswap/solana","version":"0.0.21","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.21","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"28507a3554e68d13620404c9e4fe7524fd9bbbd5","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.21.tgz","fileCount":155,"integrity":"sha512-f4dfgFTHaTGiHsA4rkXRDTMZELYKVkly+5g8hKs28c2c5N822WFSk9buWGhgaPtFC0bsCsC8TfWSNexnfao7JQ==","signatures":[{"sig":"MEQCIGrQA8iY49MiuXBpr6HFPWLqFyMBC7/Nzfkjz8+AHy3dAiAjFOQRhowmOTXkLjDhXbXdYyT2etoLCInmN1AttQaPbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":665864},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.21_1689269757174_0.5287075257516254","host":"s3://npm-registry-packages"}},"0.0.22":{"name":"@neoswap/solana","version":"0.0.22","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.22","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"12955eab03dc38e0c705646425e2ef562a5b8f1b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.22.tgz","fileCount":155,"integrity":"sha512-DYorRSfaM+/GsdppuvonQmao85mz5cHf8vgVePwefKqDzJaiZrEJBECUpsK3gQA4VNYs9ffxSeKJnXvChfj0kg==","signatures":[{"sig":"MEUCIQD0J1fj6QOi0wKevbpdqTtGsWnGzwHRqyyKlH2ysaPvIwIgRbFeJ4Bqbh9PRbij7Ci/RnX+s3tgAJycpWST39ysmF0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":665600},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.22_1689270229286_0.24111585476986264","host":"s3://npm-registry-packages"}},"0.0.23":{"name":"@neoswap/solana","version":"0.0.23","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.0.23","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"8ddfc25630b0cfc2de900b84cd6eb52f2c8c93b7","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.0.23.tgz","fileCount":155,"integrity":"sha512-pdgAOjv2gxVK8FX5ZCcEPqoTwFs5PFSfh5Gs9+2xvRnkG4fA4Z2XJQfZZ7YaX0KhC3AtNz+k8iE/R5U4yUPJGQ==","signatures":[{"sig":"MEQCIDO7lG8EEnMDgfV+q4e9c93CaMkfa2Fdu9RHsLvYB90ZAiActCmMXNsaQRXwwsGYIDvB2aoHZ8PlZniD6n2+MWxE/w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":665612},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21d830dbf0731a3e045c4a43f7e0885443945fdb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.0.23_1689271817657_0.3393615049656764","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"@neoswap/solana","version":"0.2.0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"9776621fec3b7b1d60bb01bad952d091183b7521","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.0.tgz","fileCount":155,"integrity":"sha512-rFnC3jJkrFbLrivlRLVdzO0Mdve9MENKR8JSwlb4cUOlXWUDKlGV/EgIc0zfGlTpXJ3b9u8CDzdrRXy2tCbXMw==","signatures":[{"sig":"MEQCIG/urAHf6IgybwziWymZ0t0Xahkcywk84Fmy1xWgPs5FAiBgSfj+y3nYuM8Tl2a4/I+NujcOA5WCrmVZ3ACo8M9o6Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":665407},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"bafcaf7b823041de70d8e5d6fde82269f2128de5","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.0_1689591996642_0.6051909896200662","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"@neoswap/solana","version":"0.2.1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"001720d94fc7b28d20b484722ebfd6d3bfc32528","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.1.tgz","fileCount":156,"integrity":"sha512-bvCDlGXHWD6Xglm+lSeCB3Vdgz6jiNR+n5IwHjwn0awJx7rElyyzHOX8dyCrOeh+K6VfSx2OrNWN/x/nweHg0g==","signatures":[{"sig":"MEYCIQCD4hj7SWQxMUbMAlh+CyAPHgSsW/WM76tTRVeJY7Dh0QIhAJ1aZH9jpcia5JOjQpMiiQ3dsxHHkDWP2gEO54TIMY0y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":669155},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"6b81157a336a97fb993ebe9cacac4af9c852d067","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.1_1689595326230_0.39119900547630193","host":"s3://npm-registry-packages"}},"0.2.2":{"name":"@neoswap/solana","version":"0.2.2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.2","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"135b3e6df4f6883ffc176950f5a14fbb32c86cdc","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.2.tgz","fileCount":156,"integrity":"sha512-Frmy4c7kfdGWOfb9MUK0z5zXn6pmYobN8gR2P5PnmxK+A/pWyT0VxoNyGf+kU86ZSVXJtxR+AfoqjY0FcKYcBQ==","signatures":[{"sig":"MEYCIQCIP1pye5+lpCMjozbu3v7FmuuYXtGfRyuZ+5lofPvbNgIhAL1OL5/5jxWCHlfxd5nx9IvMV9+7C8/xcapcEqdwLMgL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":669473},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"6b81157a336a97fb993ebe9cacac4af9c852d067","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.2_1689596837086_0.0545815294948373","host":"s3://npm-registry-packages"}},"0.2.3":{"name":"@neoswap/solana","version":"0.2.3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"homepage":"https://github.com/neoswap-ai/neo-swap-npm#readme","bugs":{"url":"https://github.com/neoswap-ai/neo-swap-npm/issues"},"dist":{"shasum":"d90e9c6c54353b17132d9e7ff9bdc1b87bbac179","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.3.tgz","fileCount":156,"integrity":"sha512-qXbfc0Q4aHlpSQG36xTZ8V6N0apFyQqieK2G5U57aYZQJKA36azm7CZ3Gdd6nsVBEs4DSNyWQ+HJK1YtZWiWYg==","signatures":[{"sig":"MEUCIGPfLX0FeF3HBW5qknRIs+OZKNamQ+WwzNSjR9eVFh3jAiEA9Wb4WwG7F3GYQs4IUgVk4cULluQvJyfrN9Mn6RQdlus=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":665726},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"6b81157a336a97fb993ebe9cacac4af9c852d067","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+https://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.3_1689600698668_0.21495806048912014","host":"s3://npm-registry-packages"}},"0.2.4":{"name":"@neoswap/solana","version":"0.2.4","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.4","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"2021406365e9c7b48d66df410071760bce0b9d4c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.4.tgz","fileCount":156,"integrity":"sha512-u44jS9XTZoLXYwSCZ52vFwx/bHN2nZvSgehqWoepYHxrompEx+SHgDDqN0/6IstGX2PTHFwD6ZjhaAkRG4LLvQ==","signatures":[{"sig":"MEUCIQCUkip2aDZ6oufl9OG0/ME+/+8SJWXPsqThrS2dF3Y+MwIgPE+Enwpiw6BR2ssDzGxz0HPxYDZYiBhmiWAciYefOs0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":665363},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"6b81157a336a97fb993ebe9cacac4af9c852d067","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.4_1689602261332_0.33918841402670297","host":"s3://npm-registry-packages"}},"0.2.5":{"name":"@neoswap/solana","version":"0.2.5","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.5","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"4abc046688d7d5f5f35dcaac6c1a54d003526da1","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.5.tgz","fileCount":156,"integrity":"sha512-ErlwtVwn9pPb4hv8UMQH1Kg/s1YrKDCIv/eo0n7VF0nFaNcU9cbXrVsaPte14Obp/v1w6QibF5saDk4e6bF9gA==","signatures":[{"sig":"MEUCIQC5PbgNJI8b3Pnb+Ll2/yf8QrjLaUCz0MuhC9ZL+/4LiAIgVmhEpgP3fyd6wGMnLPY1ayx1rE4Vw6U1wLf1K6ZsuGw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":669196},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"60f238304f8020e8435034910fc2c822c0c4953f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.5_1689683017722_0.6520347598949046","host":"s3://npm-registry-packages"}},"0.2.6":{"name":"@neoswap/solana","version":"0.2.6","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.6","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"82aa4afa126d947f5f1117fc1586353cc46602e2","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.6.tgz","fileCount":156,"integrity":"sha512-KUReeMXdCDnN175k0ro6Ojq2D1WJLyU8j+Lo+S1npPbUiG5X3Y4vwFjUqccxplVLvG7+tgkyrtdupGWvVCYCQA==","signatures":[{"sig":"MEYCIQCgQKa2eCmuqtC8kBetiRXtfwWX8xz1BErdOqX5juG98wIhAPhOO+x0TCkRmGx8+VxrgcTiaLBYc4LcIisxi+w11FyI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":669180},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"60f238304f8020e8435034910fc2c822c0c4953f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.6_1689683104910_0.5398509078445204","host":"s3://npm-registry-packages"}},"0.2.7":{"name":"@neoswap/solana","version":"0.2.7","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.7","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"a6a7dd3dc80301df26e30883fe6405cf9cb68b9d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.7.tgz","fileCount":156,"integrity":"sha512-4VcUciCb7GftLmXwcglJrVumJaN6sNRncpLG5YRrUmemp3Z3pEnc3GMXFdzVbTDhIB7RuefUuRmWVfhHTFMpVQ==","signatures":[{"sig":"MEUCIQCL+gNyQIebCFh0Qx4KEVHaMTqCTtWJzeI1lvpLqURGIgIgV4cL0qssS58NtrX52WeNVyXs0L6stc5sqAzmhNyg618=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":669176},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"60f238304f8020e8435034910fc2c822c0c4953f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.7_1689683155058_0.43006162964399564","host":"s3://npm-registry-packages"}},"0.2.8":{"name":"@neoswap/solana","version":"0.2.8","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.8","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d38b75a3ce7ede565180c68b9fe39e6078e14b47","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.8.tgz","fileCount":156,"integrity":"sha512-qfTm2Olm1yHZ1+V3cda/OvhwrvgSpSjUc1aOurmmf0MuDo/gPfRRVqUQQx4dbGDj9Xol/rL4Gxfcmf0lTPsAJg==","signatures":[{"sig":"MEYCIQDuG+XDq+bR+Q/eVsLIz6odGkO6clHDSy17t/rRD38+TAIhAI4G2xI6EkI6VjucqhKLpXaXC03k3LwT1D3hk3NMbY0h","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":669135},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"60f238304f8020e8435034910fc2c822c0c4953f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.8_1689683299637_0.5677356951249066","host":"s3://npm-registry-packages"}},"0.2.9":{"name":"@neoswap/solana","version":"0.2.9","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.9","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f32d00c4a9209626d226303dbedcc7f52b7494c0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.9.tgz","fileCount":156,"integrity":"sha512-sxu6w53niB/v1bhT6mHQgBJoGdLHT0q+C7uIxH96HAfMuT/Abdf/q54GUFGZqabyyn7OFgr+B5t2gNlUaBipIA==","signatures":[{"sig":"MEQCIEAVtpB2kUr1ISFEpVCZ0SUgqDAGvY7MLSop4eDOqYYOAiASpVyZ7wWRmJLINWDLuccJrlQUa1G7YmVtNabPXFql9A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":668611},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"60f238304f8020e8435034910fc2c822c0c4953f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.9_1689848567951_0.4629269747584346","host":"s3://npm-registry-packages"}},"0.2.10":{"name":"@neoswap/solana","version":"0.2.10","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.10","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"a629f36f4940f37c8e004b9153e37bd794dba23b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.10.tgz","fileCount":156,"integrity":"sha512-cusCshe07+kPgdALPfQJudGKH/iCI4FOVPuCCauQ07oBrTqx/9IGWhw/I3b0CDbiPPAOyxLYkkwFRIk6Pp8A0A==","signatures":[{"sig":"MEUCIQCdsnspkIChD7bTc4J+AFXw/5QjnklUbSVBbwuM1Rg3awIgPN0oDgo4ALEoIPrT+yId1hjVSWf5jbiQXwK8C7GuMDo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":668760},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"60f238304f8020e8435034910fc2c822c0c4953f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.10_1689849253945_0.7338252793737705","host":"s3://npm-registry-packages"}},"0.2.11":{"name":"@neoswap/solana","version":"0.2.11","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.11","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f6bf1fa6ea2eadb1b57b63ffb455bf1b3ac3cc96","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.11.tgz","fileCount":156,"integrity":"sha512-IGYzZV4PEY7WiqJq/+n/5vz2GTjQ9GbqHNYhkcLJAL8ahpjdcxJN4NFGj9RQBh881IGiGAgXagBWjEU/lsoGOg==","signatures":[{"sig":"MEUCIQDNPk4rkSXhJ/l7qE9ELVb0qRj65WxVqH+asjHcQ1BSAgIgcZG0KZR6wAsHbmEsLrKl8iu0ozxjlL+GdCeJgatl50w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":666688},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"60f238304f8020e8435034910fc2c822c0c4953f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.11_1689855268713_0.0655270696531074","host":"s3://npm-registry-packages"}},"0.2.12":{"name":"@neoswap/solana","version":"0.2.12","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.12","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"a4ce196c0830014bca7ab3b9f0c656ed50d50cf0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.12.tgz","fileCount":156,"integrity":"sha512-uQhAec27dWvIgoi3lGD11EqLK3kqzSJ/rcRAbfEk7+YmUQYNqm7VQwNeRKr8gbctkSX0H4olqYscPG1YjXcVGw==","signatures":[{"sig":"MEYCIQCI+wu/0hLSMTiLGA4uFESIkA7SwsRiRvJhZ/tsdNe+OgIhAJGUva2J7g7lbstAMCzVN2VmdOLRkPy38inDnbVDyfj1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":666132},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"8dc6afe0a92573b60831b99b54a83173818b79d1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.12_1689927443197_0.8994721255622518","host":"s3://npm-registry-packages"}},"0.2.13":{"name":"@neoswap/solana","version":"0.2.13","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.13","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"dcaefa7643072a2efdd615d4cdd2189a1dce1d2b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.13.tgz","fileCount":156,"integrity":"sha512-19mDljywUh7ggGzScycz1tvBGzU1UeXeki4TihJX4vsB8FI6zo9XGHRgjhBj8KiHnActynchfuQv9DRud3P6VQ==","signatures":[{"sig":"MEUCIHT+0ZHLC7QBXEDV8Sn3fpnJp+Tz4CmV4m+dSmut58q5AiEAgAaxVTRpU7TyXFrwIWMhbwVqKWWwvVYDzib6tdqV5zU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":666292},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"8dc6afe0a92573b60831b99b54a83173818b79d1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.13_1689929452607_0.3800650567026602","host":"s3://npm-registry-packages"}},"0.2.14":{"name":"@neoswap/solana","version":"0.2.14","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.14","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"e84a626adbabc3873e2128c5837ce626fcb83fc1","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.14.tgz","fileCount":156,"integrity":"sha512-z8mmH003hw90vlRfQ4Q3WpGHO/qya/ZSAidWUCaLTmTcR/pCi5S3s+zSspW1Jyp6IL/Q7MUfKatfnpHv4nTP3w==","signatures":[{"sig":"MEYCIQCTqIk8T7aXlXLfb4miFE0IkL1H3wINRs6GkFC1W+PcFAIhALmPu73AjbBllMXYFcNj52xkaNB4oqmF1JUfQEyUjGqi","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":666567},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"4a944404116e2a5066c4d4c3e0c17b8246091311","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.14_1689935360005_0.8651860031436827","host":"s3://npm-registry-packages"}},"0.2.15":{"name":"@neoswap/solana","version":"0.2.15","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.15","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b11a783c92c452b5357903a0a6b8d01574315fba","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.15.tgz","fileCount":156,"integrity":"sha512-ykpvswGn8GfF+7walcY8DACvJkVyGSplZFjjh+uHOTaqXr8AMPdI0R6Dx03Pw/6OkCCDp2Fafim5WRYQd8pbYg==","signatures":[{"sig":"MEYCIQDx3w0AlfPvC2UtV5yqMsnwT2YOyjwRP8FHQEZAsWPIkwIhALMVujKfpCnX1Q/Kzn3u3XkqIdFjU+6TLcSDZendpUS6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":666653},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"4a944404116e2a5066c4d4c3e0c17b8246091311","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.15_1689951063056_0.15948092578714035","host":"s3://npm-registry-packages"}},"0.2.16":{"name":"@neoswap/solana","version":"0.2.16","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.16","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"937dd7b26f97174ab176740b041df73198899e47","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.16.tgz","fileCount":156,"integrity":"sha512-nhyTfehYRR3vwRKSsedviJ5InqI9Fh8oBuATR4SS8VK/HX7dfLMkKY7VMeBQZNVBQwAaOtcYjk6adPyIHX1JIQ==","signatures":[{"sig":"MEQCIAjENh5xdb+V+0aqijQ2vDWJUB8aH4HWDZYRw4JwxefNAiBky/03F3cg2QvtgJ3Dp9I0ADiTVj7Jbl4Thr8Lpd4+sA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":669099},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"3f9b96f39dfc109763eb3cc82472e6710a4259fd","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.16_1690197966592_0.5709050383255734","host":"s3://npm-registry-packages"}},"0.2.17":{"name":"@neoswap/solana","version":"0.2.17","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.17","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"dc31964f82aed49e31566e343a961635b6aa4c29","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.17.tgz","fileCount":156,"integrity":"sha512-Zx6/fwzJ31ilUaDsCvA5mxbkqKyfetQ4d6tyDn5MuOl4a4henx5AWlxIVFq0IsQfcILvki2X42c3/Z+YsYQPgw==","signatures":[{"sig":"MEYCIQDT2HYtAcAGGle/BGMViC11WFq6RPIjf/1tSdAbeduJVwIhALujVq038Dkuem770VYWFuki5I+BqPnvDShalUGCtPza","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":669549},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"aad82c29b4327a1559c52230fafdc1006f5973f8","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.17_1690198980352_0.7427279467373866","host":"s3://npm-registry-packages"}},"0.2.18":{"name":"@neoswap/solana","version":"0.2.18","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.18","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"868e12e55e22fbf736c9ad2aef6e003cf029661c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.18.tgz","fileCount":154,"integrity":"sha512-z1iQqBeal4uz2k9iSm3YMVTLezZAmE5IH1EnzMDOxnes3ZU3DED8THpbndy3+y7LaS/GY9UrNcwMJN67OCAzOA==","signatures":[{"sig":"MEUCIEqkjHk5/Ge87/lHb+n/0/QXfySmpsnRGnXbFgaRHqYiAiEAogpU89A+7JbOssemtBaQN/gd0vq6CpSYp9QInWaram0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":659158},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.7.2","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.18_1690361545514_0.45912686622478116","host":"s3://npm-registry-packages"}},"0.2.19":{"name":"@neoswap/solana","version":"0.2.19","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.19","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ecc2ec39b06793d2e1bf0d0fd5cc43bc6b5cb2eb","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.19.tgz","fileCount":154,"integrity":"sha512-0pOf1YjvmjRAYVjyKbZ59FCryfMVSXiYhufTJzlJU0AAfFvBz03I/3uZEPM6vLQz5iHpOcay+OPP4Dzlyiujjg==","signatures":[{"sig":"MEUCIQDZMSd9IWfURtuOPNHgiWD57cjLAs+ZXOHOYaP8Odi9YAIgGTN+qqGwGJnACbcDxix0DfUFtQLVasBqSGc8Ndc6qFo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":659154},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{"parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4"},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.19_1690367358523_0.9042897550820557","host":"s3://npm-registry-packages"}},"0.2.20":{"name":"@neoswap/solana","version":"0.2.20","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.20","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"8d434113d451ee302e310633ae861f64c086badc","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.20.tgz","fileCount":154,"integrity":"sha512-TZ/VnC8Cw00TUiQ+XnsYfKHuGHFexKFqV+00ANfXSdP7K70RlBUafhj+CjR0EJ3thaKmvi9vXZgceEt2Cm6E/w==","signatures":[{"sig":"MEUCIFFp8T2qdxAfm95TB0BeLjPza1QnniO3HXsRVjWFkl14AiEAt/Xh5wR3FsO2w2o4cYYle/h88yy2/CewL605FG2OTAQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":659150},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.20_1690373237146_0.4440428223499855","host":"s3://npm-registry-packages"}},"0.2.21":{"name":"@neoswap/solana","version":"0.2.21","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.21","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"dba162acc423c8500a9020202a137c91030a9703","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.21.tgz","fileCount":158,"integrity":"sha512-cfEp2WlruUd+jf+vXXMo9ylo9MR+kmMdddSR+AM2iu8uHmkIr6kIFRjOniGh9A5e8wrwBTb+iK+fbZ40fHly0Q==","signatures":[{"sig":"MEUCIQDUUzGfaRVgf75BTsck8YJEEJncBOdj4ndcvf5RPGefnAIgcNw2uITjZNk9DGMCEgv7oM/Ul/VIl9p0v+ApRJNSe0U=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":671473},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.21_1690451877666_0.48020400003772123","host":"s3://npm-registry-packages"}},"0.2.22":{"name":"@neoswap/solana","version":"0.2.22","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.22","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"80ab7226417cae001f7ee52cb33c32d0db377cfa","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.22.tgz","fileCount":158,"integrity":"sha512-PpJ0VLqdW8GVo4tg/9AcuOGGx0HURLNLfTa3CPx0sugd1WaKLnD5+OyAF4qJ2f9gS+AJiLqBWgsp/YfM7kpAeA==","signatures":[{"sig":"MEUCIAPqnrveGcHu1gP4Etyg7Z+h/Eebgvlgbv5ThpfTu7eGAiEAoFuXSmIpBXIzhKuejdgXypriIur/syDCl/GuuvimCts=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":671651},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.22_1690452372755_0.2599838633342759","host":"s3://npm-registry-packages"}},"0.2.23":{"name":"@neoswap/solana","version":"0.2.23","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.23","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"7b84a6e2b64b9f65945a46c15861be668c6ef67a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.23.tgz","fileCount":158,"integrity":"sha512-AfPSBH0m98QBMB+7PbNohQioKB6kEdNGiw8Z+gFZTsiIL1LOOxo4geGms/9JJVdr8CpQIzKYdbN/LmjLk7oKBA==","signatures":[{"sig":"MEYCIQDqskHXyU4UuhdtwAUQ6Wgpd6HMdzujUHZtHlNv2XC0+gIhAKg7aUMFSIOrTGYAe/xOAYGkZ5DpQ6BD1MDK375uL/9Y","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":671803},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.23_1690452673225_0.41477763569288983","host":"s3://npm-registry-packages"}},"0.2.24":{"name":"@neoswap/solana","version":"0.2.24","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.24","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"de1a427ab0bb9ba55b2c95529d184838bd944783","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.24.tgz","fileCount":158,"integrity":"sha512-kaLbzz94HVQOYIQkJr1NeCrv4t3IkslybI4kJif8TjPhaaiP9OghrFnVaMxvjSOGCAEV3VG2i6666i5McAc+HA==","signatures":[{"sig":"MEUCICf7RR4bgEmOLZcghhVQ54NaVV5/uDfFtHtMCEBUs2bWAiEA0sbEcqGpBJnL+4jdYlJRUIbH7hI+OzW0vor8qR8aGEg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":671803},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.24_1690452844837_0.14943519687597684","host":"s3://npm-registry-packages"}},"0.2.25":{"name":"@neoswap/solana","version":"0.2.25","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.25","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"a57de7e01f6498fe4a5065212faee5b9cc251f2b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.25.tgz","fileCount":158,"integrity":"sha512-5KgrK5sZXiVhDFQNvPrAjL2T4XEHkzD3M1AHk2LNOq1tWKPPMh1SOZzp3FFZRmASft1Z/Ev62dAEb+Gsb23dxQ==","signatures":[{"sig":"MEYCIQCdybe6IRsWxzZmD1CkuGjR1bMwami8wkWNRzx8DpUwjgIhAOvROyXZ+7ZJeDPQvtKlILu4kujgZNzjGj8INkLUC+jI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":671803},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.25_1690452892635_0.45052313773525166","host":"s3://npm-registry-packages"}},"0.2.26":{"name":"@neoswap/solana","version":"0.2.26","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.26","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"1a4870fc8267f1040960b17d69c8b5321b584089","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.26.tgz","fileCount":158,"integrity":"sha512-nd4rwfzfRNCMdqVVbS66u/X3hBin/cRRzbkj/DAceYKue93B8e9k0XT14HPRDJY82OkmC+qqsgKe8CCpxQDjNw==","signatures":[{"sig":"MEQCIE+30Y4aTHMAk6pMebleLT4WEvWepyadrzJyJjdxHWSzAiBaOmUzJgs8gfbwDCw8+mBgwbCXVxJO1jCsP0Z9KaUNPw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":671569},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.26_1690462979604_0.6914233550041267","host":"s3://npm-registry-packages"}},"0.2.27":{"name":"@neoswap/solana","version":"0.2.27","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.27","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"6a485f470baf17bf5ebfaff8b29deccdf88578a5","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.27.tgz","fileCount":158,"integrity":"sha512-IlWPijX+9bpp5iBAKowZek/YiiIzTr/AQtAwJIneQ6RDTo8laoZ7ONWWM+ezN4yrkUMg4dIl+IeKYqKLXf7AmQ==","signatures":[{"sig":"MEQCIA3QfcGg/3MohQOo7lHLyZxkOC/q5Toh5WuScZK2h7rQAiBvSDI99YuI3LMaB597E9wY8P089ZqFBMzDRXuUt9+NxA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":671929},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.27_1690465743607_0.5254481967237594","host":"s3://npm-registry-packages"}},"0.2.28":{"name":"@neoswap/solana","version":"0.2.28","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.28","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d3d83a16c86cf7c0b35391f767a1260fa343e44d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.28.tgz","fileCount":158,"integrity":"sha512-YFHUOAaVrBzKoi2mqZ1ue1UzpjrJHHt8lMWlqhSP2G+NuQtYt2gawY0mjjz+179UiaoRSMgkCI1wU6bEHz/Cyg==","signatures":[{"sig":"MEYCIQDXM9p3xyLru5oXu4/6SnY0o7ZVyeKn9SnfDdvBP5CVEwIhAIU+QiF+uD7+AwGjJV103TsnrxnzR1IyXD2U0JZ6me5W","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":671929},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"abccda45282d68301d35cf4271cccac96d30d9d9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.28_1690467708285_0.4128647992850729","host":"s3://npm-registry-packages"}},"0.2.29":{"name":"@neoswap/solana","version":"0.2.29","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.29","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"2b85ba6b97de37270187d0df9b546f4269e7bd90","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.29.tgz","fileCount":158,"integrity":"sha512-BKM8T4pq7t7snCA7a35SyAiqpbBzwFIRSIlCO+e8cItX2gEhncw0mCX3aELvmuBJxTa7STMuGuat4hH9m1neGA==","signatures":[{"sig":"MEUCICCM4QsAFtRuIhdOkR3EPyNeN2ta20cIp9izisyvvCRFAiEAsezutwX6NN003ufZm6dHAZ/VcDz5N50VcNZB3Q9VDYo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":672111},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"37ce8b108bc68fa5f00a54a2bed6574c84ab05e1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.29_1690469258135_0.25314293288410283","host":"s3://npm-registry-packages"}},"0.2.30":{"name":"@neoswap/solana","version":"0.2.30","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.30","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"89446368a7e8a26094b58ebae822baef6b60768f","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.30.tgz","fileCount":158,"integrity":"sha512-zj5LpakDCv+PKiu4efcY2ZnOs32FV5HbWmUQajNPgBNQWs416ShhEbmSQjqvpyW6GmkE1cjCoxcq51taZH1tLw==","signatures":[{"sig":"MEUCICQLCbXdlbtjKH8L/7MQA+9lvUls3IRCT4tKE4OQ4GlNAiEA3P7VC1el4U61Lhi588FykNNClfj0Y7ElgBkCQW4buZQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":672535},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"a0e8a0051cd0300c2221258852aa768f677f5fc6","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.30_1690471018473_0.2878080168078829","host":"s3://npm-registry-packages"}},"0.2.31":{"name":"@neoswap/solana","version":"0.2.31","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.31","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d9ebd7f0d4264883e414b987cfaa769729eb8a5b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.31.tgz","fileCount":158,"integrity":"sha512-Tqtgla58KZGsCN6dH2dyNt2Ej6VoENuajgbJQSvliKmQrhHrpMT5Vo0Qv6qSQlrZaDLXG7rAF535DNBgH3ne2w==","signatures":[{"sig":"MEUCIQCBaO8mjueH302VgkwBcrpkOfjkXJlXoLvQGJ9NQCnhdgIgLXpMU4ik2cPqvbis7QS4KqgEtCt/TC6AH+o2z/Tj9e4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":672111},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"926e3c937c609c662b5ef8ccb53a1b8d859017d1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.31_1690474610208_0.8074843545091908","host":"s3://npm-registry-packages"}},"0.2.32":{"name":"@neoswap/solana","version":"0.2.32","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.32","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d7af772eae2a3b74765e988fd81c5964ebb1f6a3","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.32.tgz","fileCount":158,"integrity":"sha512-oo2B/ch2uDtRXrTrJ/YzSSuTTyKzLB1QK1dmwoFsgeOq6LCkuibTDvBcXUpi8Shf/tOGDAewbtHmVOuxQ9Oqfw==","signatures":[{"sig":"MEUCIQCGW1tI+69abaRe6ZbOWUEnX8DrN5qb0wiMcAd8XQyv6QIgMZ3ZSArSimKA+NNa6kmngxe4G8Zk1fjknyCRjYZ/hbQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":672115},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"9d65658befa68d09c1a873442686785e56f4f5f5","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.32_1690474994023_0.030350409636821896","host":"s3://npm-registry-packages"}},"0.2.33":{"name":"@neoswap/solana","version":"0.2.33","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.33","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"6c56713c51420addf3779d0f48fbcdfb232e3818","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.33.tgz","fileCount":158,"integrity":"sha512-8dNJts/jqmmPBy7y2uYY4zBDuQsb62pT/MSj1VWGHgiA5jZ6O38SHD+z7FyEjKMoQt+UA5d4+U+vKvXN2CO2Tg==","signatures":[{"sig":"MEUCIQC8dJeVgrly6JT8TeM3cY4ORvVYy80pYIqoNRB37Ew2cAIgb6rxCVBnOZy2O3csnFxfGq/RW7FJgKiMkiY98hzUaZA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":674896},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"ddc5ea330a94b2588325b870821168f6fe8a019b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.33_1690477918783_0.7160713065366191","host":"s3://npm-registry-packages"}},"0.2.34":{"name":"@neoswap/solana","version":"0.2.34","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.34","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ea47e05fd9b84ec0e0a58de0fd0d5e36222c90d4","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.34.tgz","fileCount":158,"integrity":"sha512-tT+lI+7/6rWweSw3krbI8/sBx5JlsfcguEG9RGDdmiAEvDWup2Fmc7sVZVwTFapOdu7EQvG/HXYJ5dWKKmghAg==","signatures":[{"sig":"MEYCIQDr85Xr5FtxeLTHkjytERcPKejTZtD2ivTwQrR5YQzZlgIhAJv5k+1tpD5L2D9+/pIxByYOSb/YPVk77kh0eJJSkkvZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":674860},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.34_1690490690556_0.8498676403730638","host":"s3://npm-registry-packages"}},"0.2.100":{"name":"@neoswap/solana","version":"0.2.100","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.100","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"06cf6e4afde2543682838a5eaed7eda991317d06","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.100.tgz","fileCount":162,"integrity":"sha512-qR18pIiRojTj6dxnp4m6xqlj+qalPz5xtv9OKMkTTyM1OBsoxRKQV8ayaWOYHig5gxalFbl3okKkH4DmEYmmmA==","signatures":[{"sig":"MEUCIASk7l+hzuk2HFJrT/2BXBDpQFSlfvCnb/sBIi8I1bU7AiEAgXvIu3Z1/OLHm4XPYSlBU9UTAiKMiNRCiYt4m65Z+ho=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":680060},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.100_1691134666880_0.9853543615437508","host":"s3://npm-registry-packages"}},"0.2.101":{"name":"@neoswap/solana","version":"0.2.101","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.101","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"db52b3181217f8caebba9ebae351068cafd8edfb","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.101.tgz","fileCount":162,"integrity":"sha512-8mGliTjfYIdbH3U5RNo6dEJjxkhvHVfm/Gx4CEl43NvMTQH5wM5cEtxB6/PlO7hkFtDdbIvE28nzToDIh+mCRA==","signatures":[{"sig":"MEUCIGRKx2u6RgcLRrmSLUOVR+bycBLFzVchxvyipUYxe9rdAiEA/psHsed2kaqk+sNjNRZ+vggh5SXVMxMIaogo+ZUhWV8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":680050},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.101_1691146743507_0.21831463742440738","host":"s3://npm-registry-packages"}},"0.2.102":{"name":"@neoswap/solana","version":"0.2.102","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.102","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"8a32df5af8cf235d48987ab4a177cb745ede19c8","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.102.tgz","fileCount":162,"integrity":"sha512-VrxuZ9BQQ72AwZEB1uB7u+rdPuZ0WYISQNwGbr7YIvPDR1nwVj+rX75z2kiLikCqljUuunzbfi1kKAtxbsQeTQ==","signatures":[{"sig":"MEUCIF29zvn4v9iKnrbFXN967VeNjZvRM27sKMHtas9MKxeJAiEA0pC00NMHczSQ4g8PzBjKLc95w9AWnULTny6jGjj09/k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":680682},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.102_1691409067040_0.3905332761663567","host":"s3://npm-registry-packages"}},"0.2.103":{"name":"@neoswap/solana","version":"0.2.103","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.103","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"c13d04670d9fde28f5fbe348c722a3ae23b08f47","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.103.tgz","fileCount":162,"integrity":"sha512-609VOmlQaaFtTIAlNoYJUd1btNZmgRxb3azHr2nKN/S0oelIYYkxKYnEk4q5yhAQxQ6ADtz37zx8lcXTb6t1yQ==","signatures":[{"sig":"MEUCIQCpYBGxxJiy+ol80SKWGH6WfV8dJzoMReQvhe92NsgO2AIgFUQiP62sv1MjRYIZUuu4I0nVbmK/tDZXiMG8TP8vLwg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":680924},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.103_1691409584574_0.575512291286586","host":"s3://npm-registry-packages"}},"0.2.104":{"name":"@neoswap/solana","version":"0.2.104","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.104","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"cbadb8b248653bc4c9da549c8cd500226a091265","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.104.tgz","fileCount":162,"integrity":"sha512-0ypWnTGvqOY1Yf7hnLURVCYiQowC3ynZ/55FPiqz6FMiX84H2pPDrUPjqUQdTizCHc83cqDYYNsjdYXBIqXMVw==","signatures":[{"sig":"MEUCIF9rCTjbAoN6NXp/5AsKnVICh5SRKKXVekn2Ibf/dGLoAiEA6Wp9339zrfK95ebXzp4B5C92vvOEjfkQA2ICCigWpog=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":681434},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.104_1691410500648_0.04364114552505871","host":"s3://npm-registry-packages"}},"0.2.105":{"name":"@neoswap/solana","version":"0.2.105","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.105","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"3ff1419bc1cc3eb6b38279c5d5b4a74b586ba570","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.105.tgz","fileCount":162,"integrity":"sha512-JhUBtiGSPoZbeeJ6ugkPrtmbEQD22/Xer5dIhjSDNsgVx2C7UZbnOkmU0nYkcN7DXnjdjBR41nzub92XrOX42A==","signatures":[{"sig":"MEQCIF6s72NfK4tlgaxVXu1Qi17IbW2PJhJzEl/FMhy7CBNCAiAPg9DHObB0Yv8UaTKL1kDlRyb4reOciMZnc4n9zBoYpA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":682483},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.105_1691411387677_0.601730426002995","host":"s3://npm-registry-packages"}},"0.2.106":{"name":"@neoswap/solana","version":"0.2.106","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.106","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"bb4b97b0a17812dc7b6bb975dc23934d58f33176","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.106.tgz","fileCount":162,"integrity":"sha512-xlTY6wa/C7It9Yp446aBddkdOgDgixhDEZ6rLvRpATp0N7LQB8DIN3hcx78q6sVP+kNnteC7SFfo+AJX+A7o8g==","signatures":[{"sig":"MEUCIGDpn/SB9BWiwBmX8eUi0kbqMsas3rfnh8zkV8K6ZyigAiEArTHRPOmFWkRFWIHFpuXDLtz2ygP25c8lcIZ0+gKeGks=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":682649},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.106_1691412673675_0.7814060225677273","host":"s3://npm-registry-packages"}},"0.2.107":{"name":"@neoswap/solana","version":"0.2.107","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.107","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"6e90a739f321f270f7a50766dfea447d03625906","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.107.tgz","fileCount":162,"integrity":"sha512-Po41eaYGCoQOOO1lq9wz73aKbsQHsIo5hu+JwGvCm3Jnmm+npp9Wf4iug5/bvjgPBYuA/u1IKLTAMnmY53u+3A==","signatures":[{"sig":"MEUCIQDnjF0/MlNLXXOAV+VdqwCYoYd6Z+03o6yoHZr20GL6YwIgHyDEKkpe6/tQy+MBgKQtEF3OevYAiBKeR7H2lt0eXzU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":682973},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.107_1691414088202_0.45611554419395617","host":"s3://npm-registry-packages"}},"0.2.108":{"name":"@neoswap/solana","version":"0.2.108","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.108","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"e93c3384cc89d39f435dd7ce43426f443a5b5301","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.108.tgz","fileCount":162,"integrity":"sha512-nxVbf+MCUXCTKvAT19vsBC+iRY2T29+QKrcHYD4ofX5QUHLCC/i5aIXBmHeYqC/X980T1uJTWQwFS+0u0kEPYA==","signatures":[{"sig":"MEUCIHKE/6GAsmjr9b/zFSaZ+JyF+jYloVVfx3HJT/z4H0bZAiEA/V38B019tna83zQzRm1z2EjVqYtdfGs3iZE5B5mLQss=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683255},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.108_1691416688957_0.8693708994414291","host":"s3://npm-registry-packages"}},"0.2.109":{"name":"@neoswap/solana","version":"0.2.109","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.109","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"8edfc6af79016274b5bfb225f8d7aefb66f724c6","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.109.tgz","fileCount":162,"integrity":"sha512-rM9rWKWutyywKNO7ru1/KgwdFVHUh1bpUUF3ZTBhGxyZXqoXNKq5jG9C12XFSpv7yGOInXAIkW/qMeoYuELiBw==","signatures":[{"sig":"MEYCIQCDQAVlBxigPhpaZ2UfcFzMw8DjN1SLR5C5Mo7Ysy8+OgIhAIpsiMmLr7aN3mTutuYufnNWzV8SOUlZ9cGlf0weE5DI","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683361},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.109_1691416922023_0.1729983621074258","host":"s3://npm-registry-packages"}},"0.2.110":{"name":"@neoswap/solana","version":"0.2.110","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.110","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"4943a7f8c3585148ba21ff174c8282ac53601398","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.110.tgz","fileCount":162,"integrity":"sha512-IRxDI4YUeGCgA9W0ZBgC0ct6A6JSBbWuGUEzi3aJsG2JG7/92+3fOOkyYuGj8rt+6RtLZS6cGvvOqPq8N17w0g==","signatures":[{"sig":"MEUCIQDge1ECenU5FHKfxSvH8c6gBo5eAteaiCjFo+ICcR3qSgIgUPCLlUm2s2c9HKbg4azEjbEvE68hKJ5R6E5tKXabhTA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683649},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.110_1691417423773_0.13603431743503602","host":"s3://npm-registry-packages"}},"0.2.111":{"name":"@neoswap/solana","version":"0.2.111","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.111","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"eb1e86a4bdc601352eb9a2d4d613ce3ea19b67c0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.111.tgz","fileCount":162,"integrity":"sha512-gCpg195fVrZc34Ozk3hQT6H2O5JuvjTHc1+H4DHphhnvknCkSu0JPFVCmNCELnSTql0ckNQoId+pvj3E8BG7Gw==","signatures":[{"sig":"MEUCIAMngaU67l0qYSiOVShU0C4ZfTC8ba8vteaPtCJKwNv8AiEAqIIMbADH0c0IDbWLBmTIkywqAh8Os4JvTdcR7Lpni9Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683649},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.111_1691417740658_0.48262089534039765","host":"s3://npm-registry-packages"}},"0.2.200":{"name":"@neoswap/solana","version":"0.2.200","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.200","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"bb35cd203ae5096dbd40a62ea2272fbb8e0ecb86","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.200.tgz","fileCount":162,"integrity":"sha512-WugGT73+2qE3Y5eDdth1bnsEfsyRtpiU/YcOwV0eNdBcNkXzWoWgJ1q8aJnZjwGJG/kzmX2sQ2+09ig/LkGIWw==","signatures":[{"sig":"MEYCIQC7ksbADx2nAXQVcGzaEqn2JF9Mcv8YMGLPZnKz2JhjHAIhANn3Ul872SyoCUpS1pyZ4Y8gqjxRaXLS8m5WUbtQMWGa","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683649},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.200_1691481970815_0.0011660706813139132","host":"s3://npm-registry-packages"}},"0.2.201":{"name":"@neoswap/solana","version":"0.2.201","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.201","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"724bf42c7208a0e2a53022115b52fc91e0afe5b2","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.201.tgz","fileCount":162,"integrity":"sha512-5syblVCIKgYDiZXM+89M5Am/OVdZTGSSIHwsFnX9tybJaesbx409V/PcMyq/pBGwqawIxz9H0J5vEvBuQejzPQ==","signatures":[{"sig":"MEQCIGlqfJAZMjfp4ekjsZHOXOYFU3//XeCBvZic5rpZE0yzAiBLDzjN1czZVN75QgYUXrJQMqDI6pwiQk6y6dRMyZBh3Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683653},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"1cdcdb5fd27da14e00de9d6e02ae42c50b5ed07a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.201_1691485963242_0.03071331682502465","host":"s3://npm-registry-packages"}},"0.2.35":{"name":"@neoswap/solana","version":"0.2.35","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.35","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"2fe484f95990f393228e7f1ec8acf1194ab90d4c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.35.tgz","fileCount":162,"integrity":"sha512-/Ah1KjQ7p4LrzbbLBQsnizJmZVKJskFnQVFyQqtxgbE8T6HFyqmoYyvY6bcOamAYcrD5DT/ksilqgrEbSQv/FA==","signatures":[{"sig":"MEUCIGYgbCgWLq/aIqoUL5qisv0Jn6bfl4HmXauxoP7ZPQe6AiEAshZrCP6Z1WFQg1o/0ztsFD+2O9o/c53FsiI0gygRNRo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":683652},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"017ddad60d46a3b39d7fa428532b4bcafed834fa","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.35_1691488997928_0.7780974715960371","host":"s3://npm-registry-packages"}},"0.2.36":{"name":"@neoswap/solana","version":"0.2.36","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.36","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"93b64b03d833b3abe1d15e4b089c30c68639d683","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.36.tgz","fileCount":166,"integrity":"sha512-LlKSrznwcoOH+rpnKnqfZlmJkRH187rziLIi0W2NcOYsl7sfs+478MDh9U428CDI1OFMVvyTKucdGl77z0K49A==","signatures":[{"sig":"MEUCIQD0GBYA20df4a+eH0BBZWuioqFjcAg65/M09VNUfcc/8AIgZtwN38jWKYOJj1cXXqX5wa2HZVQ+lNqV9LIKoeKadgs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":702172},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"017ddad60d46a3b39d7fa428532b4bcafed834fa","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.36_1691755163622_0.13506118773056186","host":"s3://npm-registry-packages"}},"0.2.36-beta.0":{"name":"@neoswap/solana","version":"0.2.36-beta.0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.36-beta.0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"5541bc523b85055bb6bdb9512fc6da46be418699","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.36-beta.0.tgz","fileCount":166,"integrity":"sha512-d1a+btGwjkX6zJE9J+nYdFkbgDis4CbwvzviZ5N3CPSj446bKiwSD+pM39ApoM+cIL/fTsqSEO1Ul4bTELuvnQ==","signatures":[{"sig":"MEUCIENuKBqK9Wc/D67CWNASuPilACg7cklaikFZIJO8IRXIAiEAhJsxqusLc+IYa4Z7m+nYXadHv4VZaoF+yFW25LV1pR4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":702179},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"017ddad60d46a3b39d7fa428532b4bcafed834fa","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.36-beta.0_1691755346502_0.10367823444324586","host":"s3://npm-registry-packages"}},"0.2.36-beta.1":{"name":"@neoswap/solana","version":"0.2.36-beta.1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.36-beta.1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"622c50bab9c7b3ce2f3d2845cc05518abe186f58","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.36-beta.1.tgz","fileCount":166,"integrity":"sha512-m9ifBQxOmqWd+pXxSBifuw78FzANT0A8W8m7HSAFdr8zJyUssJ5osOIz41yhvjzsZy/czcnstmTthab3wUxsUQ==","signatures":[{"sig":"MEYCIQD6uaEZN8czZcWpcbJXy5gOLj4ZtQhaQV00UjruK7z5yQIhAOa8kt/2rqWvLj92/ZARpODBK9G7ilSvtVOaTJzD5Raz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":702371},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"017ddad60d46a3b39d7fa428532b4bcafed834fa","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.36-beta.1_1691755835775_0.6311237454047736","host":"s3://npm-registry-packages"}},"0.2.37":{"name":"@neoswap/solana","version":"0.2.37","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.37","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"aed9a544f4c49115805a62a1d0b9dac8bcb7be2e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.37.tgz","fileCount":166,"integrity":"sha512-D6n47Y2AIfjqcF/5psfleW9GKKRKm3yL/xpxDJfz8Wnl8uTxRHUKPyjhxtz7n1LiCCLqlQND7gRsvcJSgs8puQ==","signatures":[{"sig":"MEQCH08CxljntSVhw4XlrxRVtcY1K0fclQZC09BV3QfpQr4CIQClLlUdA6izFEpTq7qTr0fwdApGV9SusfUyKO3cDzoQIw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":705736},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"78039a0a83e7ab6278bf5918c85f87039792f918","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.37_1691756398037_0.7989793600934734","host":"s3://npm-registry-packages"}},"0.2.38":{"name":"@neoswap/solana","version":"0.2.38","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.38","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f1300825d3cc7a7f67f5ba08eb0791f837f745af","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.38.tgz","fileCount":166,"integrity":"sha512-D5SW42c2gmFS8+4MSEhQd8KO56sN65D4R+aeQx3TTMJuS8lFCT7Y/NGiC1jnep34cMUpH3N1Pp9orFzqaVJCow==","signatures":[{"sig":"MEUCIGpagUhl6E4Er/y3GrSb5pZPvVrsDny2GGaYhn8x1WXMAiEAjLu3r9wCuFHXfTnSTdhdjp299dnY5G8Ra+zSgUZ3X+k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":705736},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"785dec66c051a34b9ec223d6538d2663a70ae08b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.38_1691763985465_0.5646485158807504","host":"s3://npm-registry-packages"}},"0.2.38-beta.0":{"name":"@neoswap/solana","version":"0.2.38-beta.0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.38-beta.0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"5f24408a3c08ecf20ce8b4f62ff7f70eb0d09b1a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.38-beta.0.tgz","fileCount":166,"integrity":"sha512-jhyj98xrHGS3oGqI50oQGzezwLQJkrp72MwX7gaWmMgpdzuLTWOktua5KWXMXOr+UUEeDw6XTFbl1E05+x6MIA==","signatures":[{"sig":"MEYCIQDViYHFGX1JaGPq9/vIRRjU7r8aeQfCd5EjYvu5AocbEAIhALi3mrdr9BiqjFbaQpkkLOzgEVLXPX+omNu4+4iJ/2v1","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":705743},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"785dec66c051a34b9ec223d6538d2663a70ae08b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.38-beta.0_1691764076703_0.09442746601050933","host":"s3://npm-registry-packages"}},"0.2.38-beta.1":{"name":"@neoswap/solana","version":"0.2.38-beta.1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.38-beta.1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"5a1d15c2a3f75c4e241a36af9906fcdb892bfdde","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.38-beta.1.tgz","fileCount":166,"integrity":"sha512-q4xnkbidqSt4CGhV3TEFqCA9zF9LbMOZW8IgF0h4HsfB4wy1lvw5/PMoSyfzjXk0GArZ8/fCG5tVLFI5aGkozA==","signatures":[{"sig":"MEUCIQC4uSWmpzCaOtf6kIu0zGwSH9XBW0D+SH3lFM0KvcWFiQIgWH8EarmDhEYbkV3EkAOeZYMAQSQnVLHWjl1aXlWHkcU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":705973},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"785dec66c051a34b9ec223d6538d2663a70ae08b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.38-beta.1_1691764162997_0.348451697398495","host":"s3://npm-registry-packages"}},"0.2.39":{"name":"@neoswap/solana","version":"0.2.39","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.39","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"19d7dfd630d922a784bd27d800731e047649f0ad","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.39.tgz","fileCount":166,"integrity":"sha512-pbZOmZtqnedYsyAM3flhz17MQdDIAQT7vKAXvf7EvCQpHprbBa9YwN2Wusf43LPI/hBUxOwqBL96xeX7nnypiA==","signatures":[{"sig":"MEYCIQCgXB5RM0EMEmp41aOGumtggqa+RjNt5Kf96F9GDmI6OQIhAKS3L4oq1zLY+cu4ZPMdv+3buwptDgnzy/ruqhH1syob","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":705966},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"785dec66c051a34b9ec223d6538d2663a70ae08b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.39_1691764251128_0.8208728624358461","host":"s3://npm-registry-packages"}},"0.2.40-beta.0":{"name":"@neoswap/solana","version":"0.2.40-beta.0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.40-beta.0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"7af40721caeefdec17bec2a1c1b15de4fc3619a9","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.40-beta.0.tgz","fileCount":166,"integrity":"sha512-vZ0A2y/MHBgEizv2XHauNVs8ntlyGZxTM3V8PsnPco9rYDdANY3d6Im6jjm5AAd3Hpj/3saQkENZjnDV4DQ1jg==","signatures":[{"sig":"MEUCIEyc5kQLlVzOf68xuEJCqjyCkQN6WMfSakiw5ylc5x1/AiEAiBXztvdCyiYshVvPtGNxUq6yvLU2RUAVTygukEZHiEM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":705973},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"785dec66c051a34b9ec223d6538d2663a70ae08b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.40-beta.0_1692030231842_0.9431758981130618","host":"s3://npm-registry-packages"}},"0.2.40-beta.1":{"name":"@neoswap/solana","version":"0.2.40-beta.1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.40-beta.1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"64565d0c1aa5102ee7a3006b057794af5529b4af","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.40-beta.1.tgz","fileCount":166,"integrity":"sha512-Ml11pMNV48x70XM/8TKnvE+h5sBUpyWswpeOYI0tTc1bUmniwPd0j9FknfO5p7oJXREcqU6JbizPU8Ilu/QSsA==","signatures":[{"sig":"MEQCIBfTichRak8X1eHNDk1ZGk+9Nijg2Yv6LlLbHVsle9XMAiBrl092xVeziD33ozDFvbQPJziIUxrYxd5yynam/FEDUA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":705973},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"785dec66c051a34b9ec223d6538d2663a70ae08b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.40-beta.1_1692030237617_0.3136340644398854","host":"s3://npm-registry-packages"}},"0.2.40-beta.2":{"name":"@neoswap/solana","version":"0.2.40-beta.2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.40-beta.2","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9b39683186e6c950d41fc9267baed76c159e60da","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.40-beta.2.tgz","fileCount":166,"integrity":"sha512-3hU2vehGKPTsKb4x7A7yXC8lwBBw86N0F4bXAWMTj50ue+YrHzkZOTsNtVjoQYP308EZ95X7Tj3Rm89Bbw6nLw==","signatures":[{"sig":"MEUCIQD5gVPSOgMH8zRJKDsPI7BYqT/EqmQ6SF8ETz+57CP6wQIgNx9Tk+hoTHQmwpgtQwCYvFUEriTApJWdneOk8SaWK7M=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":708390},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"785dec66c051a34b9ec223d6538d2663a70ae08b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.40-beta.2_1692030849273_0.6957806856748425","host":"s3://npm-registry-packages"}},"0.2.41":{"name":"@neoswap/solana","version":"0.2.41","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.41","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"683ecd8f0e7d8e2ffbb563738f0d614fd0ff1ee2","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.41.tgz","fileCount":166,"integrity":"sha512-urW9b25XhFToaPHGy8rewTqPUMhsDHy98xO4bYJK4XHbPEtYTBL+2hyiFWdFQc53oIZfOuvKBCHT4oSsWOlO3A==","signatures":[{"sig":"MEQCIF6sKL5dYx5I83JM/6Dha0YVyxHEsI3Xzl4jI6s0hADzAiBWmLXdiPmYP3aYtGeJisy6vbxpAuvtO8jQ7NkA+kGJ1w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":705736},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"78039a0a83e7ab6278bf5918c85f87039792f918","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.41_1692031438973_0.17254919662210222","host":"s3://npm-registry-packages"}},"0.2.40-beta.3":{"name":"@neoswap/solana","version":"0.2.40-beta.3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.40-beta.3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"88ad266d0392ae8e78bf8c235ff0ccdacbf466ef","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.40-beta.3.tgz","fileCount":166,"integrity":"sha512-DsD6xKpSwfyMBAvxA6eaiBDvKPt7HAT+t+loYMcMjOSDek/OjgPRBk4pHV0rDHG8EumC1ceRobppaPLd1+Ot6w==","signatures":[{"sig":"MEQCIDzprPYptYQOhDVGeuSpW9QQwDBjbTHDixvEP0DQcYYtAiBsUePyelYzM81eW8wlMZcpK7dL3SS36qqnbavVY4ZFBw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":708208},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.40-beta.3_1692032273115_0.03160239449019464","host":"s3://npm-registry-packages"}},"0.2.40-beta.4":{"name":"@neoswap/solana","version":"0.2.40-beta.4","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.40-beta.4","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"216f1ab04a94041ddc2ddbfc0def9bb41b38566f","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.40-beta.4.tgz","fileCount":166,"integrity":"sha512-iIaq8Hnsm5Vpr42NXGbZvHJd5hD3+OnqHQy6HEpiqFkPpvtdXCZgSkarBVuRDZhzAP+Q3UwUSlW4qKL7KDMLYA==","signatures":[{"sig":"MEUCIQCq77GxAPD7wxJbsvRMHggp7+3ZYMUJz4on+KNjP63vEAIgfPb2SY84tYKJnChpe+c5cG20P9DInl11Ku4WnMoLN9Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":708434},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.40-beta.4_1692032366315_0.4803645016191769","host":"s3://npm-registry-packages"}},"0.2.40-beta.5":{"name":"@neoswap/solana","version":"0.2.40-beta.5","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.40-beta.5","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"5a5492370bfcbfa69c0b026e489982a4bfcb3331","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.40-beta.5.tgz","fileCount":166,"integrity":"sha512-v0oR8z8TtnSYXlX/YVvy8BE0leE6OpZufo3SO2xQDP8oNgxCPEh1JqBk/7PAZzGbGcpvhFSdjPILt45sAJm7bg==","signatures":[{"sig":"MEUCIQC2g4UuS0d1OlH4AhHCyfrnjlkVZF1ZdkioQ5HmC1/19gIgQj3Rq+A4xuA+pHiY27ecIVSwFRZPtIEwv3itHxfCL44=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":708844},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.40-beta.5_1692032636658_0.6520970174707692","host":"s3://npm-registry-packages"}},"0.2.40-beta.6":{"name":"@neoswap/solana","version":"0.2.40-beta.6","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.40-beta.6","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"a12103c50888228670d819ca9e93bfd124e6316d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.40-beta.6.tgz","fileCount":166,"integrity":"sha512-yNEMMgBOLHxz6CY1IsKtz2N2Rg0lRZd6xy/+ZyF5fBAE1+AMlexP64G2Nq0gXNfSn8kDaZFILZqhPVqexzk3Gw==","signatures":[{"sig":"MEUCIG95gC4XHjjus4e/K/ipV1CiRZfX91P4GNIXYfYR+xoOAiEAjzqIb/ccMu+m/JqpIVi4+IyuDA1ta7E3e4gP+A8UnXo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":709072},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.40-beta.6_1692032766974_0.8491459436105442","host":"s3://npm-registry-packages"}},"0.2.40-beta.7":{"name":"@neoswap/solana","version":"0.2.40-beta.7","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.40-beta.7","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ba337c9a11219fc220ccbe7358066944407e7e75","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.40-beta.7.tgz","fileCount":166,"integrity":"sha512-Zoj9RKF30wc2Oj/gohXTOcxmGwJUJWY3RZXsEPcypi0Cm77SrL/2syxH5IzRHp3scRezq9CP3FYWZ2gjs60Akg==","signatures":[{"sig":"MEQCICe+8dksckJ3TMmcOkR3//5istPPlRodVOp3c4pj3BWgAiAfNtZEVa6NSrGTRkR/VBLssoyR/KHxuZZZGQRE825Z3g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":709072},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.40-beta.7_1692032906462_0.7010933891196469","host":"s3://npm-registry-packages"}},"0.2.40-beta.8":{"name":"@neoswap/solana","version":"0.2.40-beta.8","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.40-beta.8","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b9dd1a3f7213670053efc146efc9311a538387d8","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.40-beta.8.tgz","fileCount":166,"integrity":"sha512-p0lwzGefN4wyqKyYAKpr7GzIsSV3NvVfFcuCV2+6ECc0uLhUtVWtEEbQqLG3rrXdFgL3mj4+DUqcSe3rsJdfIg==","signatures":[{"sig":"MEYCIQD23XQz36nCrMN7lDHTBLfVxBzDmOJu4BOwKnID0wghOAIhAKTuNDs2bdLDfcMmUsad8IwxxQxtzbTzM8q6PIFQjb5e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":710748},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.40-beta.8_1692033083657_0.8821685248970375","host":"s3://npm-registry-packages"}},"0.2.42":{"name":"@neoswap/solana","version":"0.2.42","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.42","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ab28cc0826892f58487cbc2ea1c2c19fc6f0ba8a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.42.tgz","fileCount":166,"integrity":"sha512-E9/OR+41ycGRf0CxRqiXMjQ3z+g21gm1OjMb/kTnp4Ad6KxJQ7YTab+SrBPbDOB166sNl4bQyOT59EEpGxZGdQ==","signatures":[{"sig":"MEUCIQCaJ5ZuQm9ycjgTcGydFddVNuteEdAnGWu1DLX4SfvTzAIgN+6irsBGlwxIqKKUVUwIqsuHjflKx+8X8rP/DfgMwG0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":710741},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.42_1692033201082_0.45031691705498234","host":"s3://npm-registry-packages"}},"0.2.43":{"name":"@neoswap/solana","version":"0.2.43","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.43","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"7492d31b7a46c544e7b049958fe20b1c5c4d289e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.43.tgz","fileCount":166,"integrity":"sha512-JJo/YhzPWAKyGJUcHE0Qy8SAItzDhvDPm36gn1cD/oTEkpdZwh2I/L4fZ17ZYYE81mUMhewriRx57zhZaQcaXA==","signatures":[{"sig":"MEQCIC0maCbUNkW9TVgCJ0jkuhFop6SjC04gzzGPxdZh+mGfAiBMY3zVXEJD5xfxz2HN0oGW4GqOH4JCTgLKIBlMSsGfWA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":710741},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.43_1692033280364_0.14758533133105867","host":"s3://npm-registry-packages"}},"0.2.44-beta.0":{"name":"@neoswap/solana","version":"0.2.44-beta.0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.44-beta.0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"245fbfe7cfad669822afdf69c785cbe6cf6239c8","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.44-beta.0.tgz","fileCount":166,"integrity":"sha512-ep6JEoaporEdhtPCTyUMgSZL4jhfCwlPG40tMg+c0iEcY8jw61pDWm7d8egrXNjnwgCvhm25ol2zgfDRP7FP7A==","signatures":[{"sig":"MEUCIQDXxJi3emIcotpe643VvDXHfMx9+KHJUz8RAt0ynM2aKwIgAIDDeUutT+Ax0ijgBQ5KhIBRa0D26Uvj4s5Mya6DvQk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":710762},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.44-beta.0_1692038092719_0.84034843762287","host":"s3://npm-registry-packages"}},"0.2.44-beta.1":{"name":"@neoswap/solana","version":"0.2.44-beta.1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.44-beta.1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"c014ced33b2400b1a32071d150b36f6f0586263c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.44-beta.1.tgz","fileCount":166,"integrity":"sha512-jINBDkvPNxx2dgwGwqVJmmtpOO3rnJkSsBZ6k8ljIO5FMr4dXe9KZ+FeafQB8e9j/u0n52hpXD51KD+NaA4IFQ==","signatures":[{"sig":"MEQCIBJvWTLy5/rtLxtMCACAX1biRE/w9uAsSUbYp9GcmBD4AiBgxgJGF2dvTgwc/4f5xk4joEGjM4NcAKQ5KTRpywtMJg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":711080},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.44-beta.1_1692038456754_0.34730131280189247","host":"s3://npm-registry-packages"}},"0.2.44-beta.2":{"name":"@neoswap/solana","version":"0.2.44-beta.2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.44-beta.2","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"679b69f907f6995b645875b17aae7445a87634b7","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.44-beta.2.tgz","fileCount":166,"integrity":"sha512-MRNE3ZrQGcy2WvdExNtX1Yht270e3nOKWOgdF4wzZmXjonjIWopms1RBlszfXqss9dlDWb0Qx7KZ95mLW/v1xg==","signatures":[{"sig":"MEUCIDSuyOpwhSD23AH1e0hHW/B9OznbnHwIj1arBJMkGFTQAiEA+qh7gLFNy4sXw0VpiMwY6SZiAU88RBE+sV5oD5nSEDo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":711524},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.44-beta.2_1692040258076_0.7789263252948773","host":"s3://npm-registry-packages"}},"0.2.44-beta.3":{"name":"@neoswap/solana","version":"0.2.44-beta.3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.44-beta.3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"5bcd117857fc98f8f2f4026f05ab742625b0316d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.44-beta.3.tgz","fileCount":166,"integrity":"sha512-mIwQ89JDtVzccuM2pXxfGjK+Q/Vet9Sw3l0AD4rCnyS42hWqIe1WSraOxN4rQWTVFAT1nqXapzU/DuoOrgNhcg==","signatures":[{"sig":"MEUCIFRImNSsMJX/xx4k+JQsZm7jC3CLisYgNoQ4j4zs2cjsAiEA47lmLu1rMq1LojKWLJmjqy2xxpGVt3ArGMGKUAKgXjs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":710886},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.44-beta.3_1692040557422_0.11418483413839886","host":"s3://npm-registry-packages"}},"0.2.45":{"name":"@neoswap/solana","version":"0.2.45","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.45","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"73720c02eac75ae40fc34e3098c645b3976a468a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.45.tgz","fileCount":166,"integrity":"sha512-sdDiecEI7NaU1ZVDIP+nGmwu8WQDBuSrZ/oMo1Bmx39+AMTmCsx8ZxufL7voRSqubxsDjM2d4FiNM1BMkjSKxg==","signatures":[{"sig":"MEUCIQCWNe87jrAl3dakXYpdEzx1FGjmTRvyefQ+SNsQ/jA6BgIgDN5yt20UWyeepiDpTD/R1X/T0I3t6XtCKgjG7x2KDVY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":710879},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"21ba23ef6ebc5900d1818b2eda99ced40fe6226d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{},"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.45_1692047337898_0.9930605253073681","host":"s3://npm-registry-packages"}},"0.2.46":{"name":"@neoswap/solana","version":"0.2.46","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.46","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"84340715882833a61cdd39b356c04a8452ed29cd","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.46.tgz","fileCount":166,"integrity":"sha512-WyYtFR6KpPJEhR8BdTwultMu069QMsGsfn/pJNxRM+bc7ChwYsS3wUV8CVhfVURiYqQF7iCbzTCGP7UjZQ/sXg==","signatures":[{"sig":"MEYCIQDxpKS98HR0fG+LR0FcufVy8SdXUjnJpPwPeEV+wzUzfgIhAPvsq1terk6q7+tZ+XmY6xP3H+B2IicYDuJkJqlugzro","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":713194},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Status\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n- if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n- if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"71a4db250129e0a0210820e39396264e6ec4554f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.2.46_1692335328780_0.5523227932089676","host":"s3://npm-registry-packages"}},"0.2.47":{"name":"@neoswap/solana","version":"0.2.47","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.47","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ae0684fd3867581ec4734c17c077ae72091fb0db","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.47.tgz","fileCount":166,"integrity":"sha512-utFTNPS3Q6eTJy7hKMy3Z/HguGiNiC3x5vsxiIyn7YFqe6PgVBxaTnLWP5nwVw/U+v58LepDyDBiT+rsKpjUAw==","signatures":[{"sig":"MEYCIQD9qz9wjjRMDl9FMkp5jG5IB8cQfREdvP9Zud7crhoNbgIhAJP0MLI8u84Ckj1yUvWddVKMt09NmjRBvieQQp28nOd0","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":714055},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Program Statuses\n\n### Swap\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Items\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapData: neoTypes.swapData, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"345d2cc11d853d9968cab3ad09c8c92bd06556e7","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.2.47_1692341456413_0.3238068882937195","host":"s3://npm-registry-packages"}},"0.2.48":{"name":"@neoswap/solana","version":"0.2.48","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.48","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"801dcba5a1d033aaa930eedc5e4fbacb5883bfad","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.48.tgz","fileCount":166,"integrity":"sha512-EcjZgkjRUoDTXQyEKiCIz/Tont0Qugmru8jUeb/CGiqkbS/fQw2RRpgPxVFgJk5N3kBZgGKsZnQp2JbezMm1zw==","signatures":[{"sig":"MEUCIQDeQ3GZb/uxtm4wMErJiQ+qFXhN7ci/WAv5+0OrMVLK/QIgeH/Fmu+DGTvO1Rob4ba8OC9oz8WQLSkfO0sXWXRgBFs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":713763},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"57ff74b72e86440d64f93e7272c35c126c8a7c0e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.48_1692360144517_0.4705268652859764","host":"s3://npm-registry-packages"}},"0.2.49-beta.0":{"name":"@neoswap/solana","version":"0.2.49-beta.0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.49-beta.0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"826687c9b10a1d1306aee083886c22cd1f5a3268","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.49-beta.0.tgz","fileCount":166,"integrity":"sha512-/EWaybRQ9W+DZJ9Vfh37IDquffovwM5qzZDHQnhGTWtcv4QQvPg0Zt6o8TUnHphK/qdlMdw0Hoh3V04GNJDQXA==","signatures":[{"sig":"MEQCIGX9LBJNqGhJD5++kG0eNdim/9Mob7JwnOXqFzpHMVD0AiAV3fwB6S/CLYEjaAyAoT3wTPXNt4o5cBfWgJoJClaSEg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":714472},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"f106b10d2d17115e933db1558ea1c943903e77a4","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.2.49-beta.0_1692785488045_0.1013172569448424","host":"s3://npm-registry-packages"}},"0.2.49-beta.1":{"name":"@neoswap/solana","version":"0.2.49-beta.1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.49-beta.1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"559039c1e6e52fb3a487d0e71dcf2df9ea48a257","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.49-beta.1.tgz","fileCount":166,"integrity":"sha512-HJ1iPi5j6qJRJgDsbIrpfpxSzO574rP1SDZs8LZAQmw+BRkHavUtKgethDwY8KvE+PSNb3mSAj28YbF7wTJwyQ==","signatures":[{"sig":"MEQCIC5dzJPYj4EoQ7DK1v90MkaCtrNzNLErjimZLBMJohweAiBlzjsVe73whfTAF/e97H/ya5ElCMK/C0fyNa9ayW89cg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":714512},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"f106b10d2d17115e933db1558ea1c943903e77a4","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.2.49-beta.1_1692786659511_0.8617093408010472","host":"s3://npm-registry-packages"}},"0.2.49":{"name":"@neoswap/solana","version":"0.2.49","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.49","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"01406b9778a99c1972768bfba49a152513e7706a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.49.tgz","fileCount":166,"integrity":"sha512-yiDq94ZQ0izueZMCsLcHACKyQqzg9GtgUx9Gix2hOk9QWDpzrLJCGzb6R3BWdVs5irN9Xw6LjYVJyy8ACqoRGA==","signatures":[{"sig":"MEYCIQD8c3B0lkb9HrSFqEkrrNOoK3GZgl3sFEskAEBNtuEt0QIhAO8UlprX7JITImArJdGEDHFxQdUYcE+2BL8nypzhT5Np","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":714505},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"f106b10d2d17115e933db1558ea1c943903e77a4","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.2.49_1692795512192_0.3383722644999494","host":"s3://npm-registry-packages"}},"0.2.5-0.beta0":{"name":"@neoswap/solana","version":"0.2.5-0.beta0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.5-0.beta0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"68e5a2c2cd71a9b5ace30d595b5320c1721790fd","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.5-0.beta0.tgz","fileCount":166,"integrity":"sha512-tAhhlIvOvzzYkuG9HmCriGZuNypCVOAbFfj6fXzOUwZ+p6w7sUdZCu5SJV1YLKVeb5Xd92W19ikUWBPS1OPpQA==","signatures":[{"sig":"MEUCICoID4QiTCFpCVeIjuku1ulhmIVs0jpz4+ZlfAgKGJ0XAiEA45Ol8w6perosQzJk7g2nld5OGFaDQcaZdwwITwh+uGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":714497},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"133ecff2ed7300fcffb4fd3421a53b3eab03d6fe","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.2.5-0.beta0_1693829924268_0.01699065523509269","host":"s3://npm-registry-packages"}},"0.2.50-beta0":{"name":"@neoswap/solana","version":"0.2.50-beta0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.2.50-beta0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f0220f672541a7d5b0cf020d88bacb37d6f1adb6","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.2.50-beta0.tgz","fileCount":166,"integrity":"sha512-mWGGnzT/3y7o9xzIxV+EKunthMs++CvIV5aSDrpXYWdHKf+dMdk03frHOhTQLwG3OnNfc5kYsqJxz4BtI0UCIg==","signatures":[{"sig":"MEYCIQC2FS3ntu7tiJrxac6wMoFczUjZtXGd1jNxeC7cmvtBrwIhALQZV5tYOaSrWNbiok/HaOwvUewrRX3k/Q9gDwH7Hqms","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":714497},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"133ecff2ed7300fcffb4fd3421a53b3eab03d6fe","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.2.50-beta0_1693829987194_0.4721893923321314","host":"s3://npm-registry-packages"}},"0.3.0-beta0":{"name":"@neoswap/solana","version":"0.3.0-beta0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"96a89a8b622f488b8421adeb9d95745865ff3bc6","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta0.tgz","fileCount":178,"integrity":"sha512-gCyb3zpHAAnXw1oXo8wNwsv/uWrEiH/wI2nSw+Ma5zi3qJ1/wJHRHRg0CT0Sq46E+mbe9rlL2U0oipW7qbzPZw==","signatures":[{"sig":"MEUCIQCuux27PMwHclf4lux3LKplKzbvsBezbME7Mu7WzQhAXwIgN3ncH+D6UkZU5P1XdpHqqI+PhHJ8nIKiCeQ/yBy1CEA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":800564},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"133ecff2ed7300fcffb4fd3421a53b3eab03d6fe","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta0_1694414586841_0.47895048838891086","host":"s3://npm-registry-packages"}},"0.3.0-beta1":{"name":"@neoswap/solana","version":"0.3.0-beta1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"99bf2ada3de4f872b7ffff138b3d70105362003e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta1.tgz","fileCount":178,"integrity":"sha512-mTmIFTgUjaZ0WyGJ+iM23h5xTnsVlC//nGmp/HGaEnL/ayF7X1UwXcQCipYhAw885cfczFTzjow3scYLk9Q9Cg==","signatures":[{"sig":"MEUCIQDy0ydqmQoiiv9Zpditkwy/Oi8SCEr1B+369/MliojiJgIgSUK/NuuRbfmw8iB0y4pcutG7Flz13HOoAGWB4W9+UII=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812715},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta1_1694435360342_0.3572825961144206","host":"s3://npm-registry-packages"}},"0.3.0-beta2":{"name":"@neoswap/solana","version":"0.3.0-beta2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta2","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"edc1ca28a0ce304a54d5e86932a60c227a10a7e2","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta2.tgz","fileCount":178,"integrity":"sha512-uNnE9uDjVUeq9TkOYrotW+9aSXYGd3bXhd61l+mdLcwb/IcMB+5/EQbQufuevMRcTiAtSajd34SXVbMuuLwbAQ==","signatures":[{"sig":"MEYCIQDWe3ntlX8w9w1hDjocfxWqaC3xzirRCHvJqMyAUCU53QIhAPud0fdizzWtPw5MEZWN8JSNoq7i7FtQbnzLW4Y4LkrG","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812197},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta2_1694493578938_0.47755401740920056","host":"s3://npm-registry-packages"}},"0.3.0-beta3":{"name":"@neoswap/solana","version":"0.3.0-beta3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"c561e77f1e23066d25f851e3e2c1a9166c5dcba0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta3.tgz","fileCount":178,"integrity":"sha512-Gr2Aqp7dbnKr3rJ0kaF8p+y0ZrMzy7SV5rXjM0yUptzgA/WRKCX4S3xBC3xSkZisBNee4/0b8SWhzE/yqJB/LQ==","signatures":[{"sig":"MEUCIFk5/WLmt6xlX0shPAhNEgTVPWBw7WSJsYLMk62WkKqAAiEAimQp/BzlnOzDFdTH1WGL/402VRt/dtcJy4coF6ZIP4k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812313},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta3_1694507402739_0.39109143987418604","host":"s3://npm-registry-packages"}},"0.3.0-beta4":{"name":"@neoswap/solana","version":"0.3.0-beta4","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta4","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"fc0bd2e1450d4650f71f00fd39613935bea9e389","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta4.tgz","fileCount":178,"integrity":"sha512-pe6gQaOvFjA+o1BmuU5xZoWKkgiixFQMfu3EoxoIc++G3h1d6HmIyPmVbN27EeecHExfS2/SqPHlhVcKxycBTQ==","signatures":[{"sig":"MEYCIQCs7WRuvC35Hf3dvmkYWc7mtjT9RGc9QIyZA9lHCMr5gwIhAMR3LVShrsi41Z5wPqSg+MRkBXlNaAExF7EnZJ1d+C03","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812313},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta4_1694507725452_0.9289968722901527","host":"s3://npm-registry-packages"}},"0.3.0-beta5":{"name":"@neoswap/solana","version":"0.3.0-beta5","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta5","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"42fb70d3440fbf82623470c7aadab9b2c9147b36","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta5.tgz","fileCount":178,"integrity":"sha512-aR8jeSQKuzcS/uupKhaJ+efCrtgihmfCsxaYqiMLOF0DmniNvyTzsQFbRDWL6mwJrVzSnzvKrGuapkD2rgoyDw==","signatures":[{"sig":"MEQCIGAd7eXbPcf9m9F1iP+H8dRvk6gTrONaJf19CQidEiLhAiBnak9Am0R6e6on5AINotbX23HRxzNcor81wGINOGMMyA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":813064},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta5_1694508142569_0.04923976593754076","host":"s3://npm-registry-packages"}},"0.3.0-beta6":{"name":"@neoswap/solana","version":"0.3.0-beta6","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta6","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"4816aad7db0391643ba3d3d5fe69bc841dca23db","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta6.tgz","fileCount":178,"integrity":"sha512-6adIoH4BobMOEFIJ4rjjSQhmyYj4YstDUBoxepGyWLJV3F7Idmrpo8/2tbZELsW19J4HxjkHZgWl+WtXU6afXA==","signatures":[{"sig":"MEYCIQCeQpycObrBIyd+BnjKJgzB46375OcXTgtj2nujPMt+RwIhAOn0Ln+CDMaVmfjq5hMfcyDs/ex/lSBeHItjO8jZv7Go","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812468},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta6_1694508283378_0.8636592049877951","host":"s3://npm-registry-packages"}},"0.3.0-beta7":{"name":"@neoswap/solana","version":"0.3.0-beta7","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta7","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"71df4d4d292597d57cb1271621cca78e22d19160","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta7.tgz","fileCount":178,"integrity":"sha512-ZgGV4zj5qmTveVfvFZdND4Zd6VGnuis0/qMbUrvnN9vGBRC/zNKhKz4TI/fKHIErTXiik0N01xhiH6pbn9WP9g==","signatures":[{"sig":"MEUCIQDf6ojLTqLsgs4uRM4+j9ozz19Rjfoq0Mqv3Eh0N+24BQIgEgdL1YV65DtgMeLiLCXukI8ELauVL/TLHQUf+YTLhLw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":812644},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta7_1694508443159_0.9024416511453173","host":"s3://npm-registry-packages"}},"0.3.0-beta8":{"name":"@neoswap/solana","version":"0.3.0-beta8","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta8","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"dea6f547709bfa964fe20b0a51647064f0848fc6","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta8.tgz","fileCount":178,"integrity":"sha512-lTHU8Rsd6QkPJmyW1lAXmo4Kls7RFfv+P7NZgAo2Zepscyez//ElWXsoQ769M21KDBJPZucQ5MSCV5wJfGLFKQ==","signatures":[{"sig":"MEYCIQDJ5chiipwhAxz4jshqvZLAK0B5FavPa7pMBe6q3AWn7AIhALVcVTHEXStzj+jmQIzuy475CMBIlAuBSRDF92x9/rD9","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":817980},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta8_1694508550400_0.35115325830487376","host":"s3://npm-registry-packages"}},"0.3.0-beta9":{"name":"@neoswap/solana","version":"0.3.0-beta9","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta9","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"eb305f54bc6b67394e79117dbf344b04889f5279","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta9.tgz","fileCount":178,"integrity":"sha512-bA3wnI3n8q87+Y5QjbF0zQF75Fc4/z+EhUO/WE9QD/sOEBTwgGJbA2pEEuyzzwU72uVu35pS3N8V2GkHGr/vQg==","signatures":[{"sig":"MEQCIBRxsv9OnE6Fgrww5MvOmI+peI3tj9QnMyrU+N65Wy7uAiBA+rt6TFWxLcLAeeQ/oe0oqtXTTxd8PltAtuWkLsQO6g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":818000},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta9_1694508913446_0.22649115765045846","host":"s3://npm-registry-packages"}},"0.3.0-beta10":{"name":"@neoswap/solana","version":"0.3.0-beta10","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta10","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"542d991e70e88c96b3b09ec2e6209e656ac06f5a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta10.tgz","fileCount":178,"integrity":"sha512-bqxvMLbPtVtpCPkJ78X/n0P2bGxXPZ6oLcTGtI1CXXNlOD10OMgUeQd6g5eZei/4EnYS67AVISgng2lVGBpwzg==","signatures":[{"sig":"MEUCIBpc07DLMSpzD30lsHlJwpWVahwgP2jZA+8CPXaN5H+0AiEA8d5L81h3yYHHnSeqyuyerza7v9AA3GiKC51cH2CHhTM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":818035},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta10_1694509038270_0.5397584058784721","host":"s3://npm-registry-packages"}},"0.3.0-beta11":{"name":"@neoswap/solana","version":"0.3.0-beta11","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta11","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"edead75fa8469f17598cf89a88c05f3f7bcc2a4f","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta11.tgz","fileCount":178,"integrity":"sha512-wME1j2gUGRHypQvLGC1sLgxTP9gMA1VabVKDMryPeo177tWLix4HIBZnblxX1ZUlEpE9i9GvXSVtQA5KkYPo9g==","signatures":[{"sig":"MEUCIQCoLUHGV6zma7qAc1cChjEflQwkTmbaYVDRJ0EX7z6JFQIgPnqIC8G6jnF3+rjX2KNa1hM1R3AsXny+7u2L5fmYKdo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":818062},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta11_1694509818317_0.42964629254336373","host":"s3://npm-registry-packages"}},"0.3.0-beta12":{"name":"@neoswap/solana","version":"0.3.0-beta12","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta12","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"e372761b0452639017738149212a6fa7b53f2100","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta12.tgz","fileCount":178,"integrity":"sha512-ZKAQxAF+z7rpdORFXldEDNtXA9jCaYrYzyV/XZHkPE5rc7o2llknF2EtByqGr7MFxLDjZSJiYjxc0G2forIy5w==","signatures":[{"sig":"MEUCIQDLUZBinArn5Prhbzd2OhivsBQ5N1R+CF/6qG7cNeiQXgIgPOAQsslmFlEpdWfN8s+CEjPu0iuuZahdTORwqDJ+fAM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":818172},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta12_1694510730654_0.8911063046169836","host":"s3://npm-registry-packages"}},"0.3.0-beta14":{"name":"@neoswap/solana","version":"0.3.0-beta14","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta14","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ac5e1cd0d455c996bf2af0a3f94e4de0923a5aec","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta14.tgz","fileCount":182,"integrity":"sha512-oJ7iS4N3hqJmFnQsJOx6vCsr1wOzQ078KRcmVHHNSZgpj3gL1xGAdy8EzRLvmxWz9KQNiNHy1eAnnUJepLp8SQ==","signatures":[{"sig":"MEUCIETL8xpYaHOMZZEdIi+4MePpSZLhtVfmn3haqYfJSPl0AiEA6GldYpFXuK75po7yqKJPWUKAAJjxJYKZvkp8aHariGc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":827750},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta14_1694512047209_0.9963132550868803","host":"s3://npm-registry-packages"}},"0.3.0-beta15":{"name":"@neoswap/solana","version":"0.3.0-beta15","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta15","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9d291b5ba3cb74e4977c5f6c040b62ab13617a25","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta15.tgz","fileCount":182,"integrity":"sha512-KKC5oBVyG3JG0HcGwqRBUk7D1O3riqzcuiMB6kiLTht0+jhTwewohCTFQtXtn0lXPFkhZJNQlv+fEKSsiZ43DQ==","signatures":[{"sig":"MEUCIQC6Cj5SEFsSQavD/mLef5ginS1nyAblDnbwQfGv8xmCygIgSZEXkXjp5exIhUsYvTKOSN7/QOHveUtPvHGl3hET1jw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826828},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta15_1694512500888_0.9113872309817368","host":"s3://npm-registry-packages"}},"0.3.0-beta17":{"name":"@neoswap/solana","version":"0.3.0-beta17","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta17","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"4f69ffbaff055202c844440bb6012c3271477efb","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta17.tgz","fileCount":182,"integrity":"sha512-2kdcGuRxuRsqNCe28l1DkUbLhfv6Foo3OVi/tmcpGsH1+WydfsJzmeqi5Sg5beQax93O7UfMnF12skCnvTcEAQ==","signatures":[{"sig":"MEYCIQDrFzhm+zm8vKF7rH5NJW7eoUfPsSGehsZmT3TtuBSePwIhALOlm+lwh4FRJjhHRRhsjhMNQEDW2wq1daozanW+P92P","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826564},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta17_1694512682860_0.38473643803611","host":"s3://npm-registry-packages"}},"0.3.0-beta18":{"name":"@neoswap/solana","version":"0.3.0-beta18","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta18","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d7d7849da0a8e9685728cb1c98117e994e315f27","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta18.tgz","fileCount":182,"integrity":"sha512-90Cmga60+3E/tw8PtXp9ns13Gti9oiaGCKOZMhEZwArlVLk3WqEZJTKB7edSkG8D/2+4DCKXu4rw+yrEjrF0Zg==","signatures":[{"sig":"MEYCIQCTcEaQmxWoh6ovN33DKejZorXLz2T4XelfwESYrdPIiQIhALPU91xzDsWqwEcmScangSNqYho6Z48oDyQfJnz3cPUc","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826828},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta18_1694512824590_0.12185263806840996","host":"s3://npm-registry-packages"}},"0.3.0-beta19":{"name":"@neoswap/solana","version":"0.3.0-beta19","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta19","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"8e1a1899c46dd8492db2162d46324683a3241b80","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta19.tgz","fileCount":182,"integrity":"sha512-aOOfQ6vb0MlpvUploDAcVIOyoBN7NDOzT2/LLA+YRpyqq7qNmv/ClbCt55do1K0EnBpTGhl6umVgSo2ZpnQnNg==","signatures":[{"sig":"MEUCIQDKtdVkxvQ8riZACjZacG4QkD6wEK0yJZRj0UN/A5AcngIgBZ60ZGiGUJPUQQvF00/qu39af0J/JlV105v5q/tfbLE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826828},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta19_1694513017922_0.0034317962456678064","host":"s3://npm-registry-packages"}},"0.3.0-beta20":{"name":"@neoswap/solana","version":"0.3.0-beta20","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta20","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"5680c1d0b4f3f59acb445228f6d8d654cce59ea0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta20.tgz","fileCount":182,"integrity":"sha512-ZO6gVXJFehKnkixN/GFSuhYYn0ZOxzQdHe5GRdW4q38bNE0YUVeQzS00cYmt349VS/0hUyz4MkTBJgoFjReuJA==","signatures":[{"sig":"MEQCID2xvgMkAgx31Tpi9S6Wq8DaMIu8mPLgWY8XWJOj3T/YAiB5DfsAiBMkxKglVzGJ5mQBx5rEBBZRUzXD7yNJUxRaeQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":826808},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta20_1694513931028_0.20835421639413854","host":"s3://npm-registry-packages"}},"0.3.0-beta21":{"name":"@neoswap/solana","version":"0.3.0-beta21","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta21","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0482207c37c2eaf11c5d9b5985a49686bd19317e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta21.tgz","fileCount":182,"integrity":"sha512-3RbjFgMoIzqHz1oFf4hlaUMBdeOs7C4MNwfpwOXk9+5+/YxF3maYtIsTAG6jbh5DzIdcJUifkUB1VMutAJ3Qqg==","signatures":[{"sig":"MEYCIQDTvt2siY4I9xij5PrB8eYEeqhmN9MKpvnA+AKivcEG0gIhAP61NIpa4gFykcyYU7zoZUXE3k6ZkeBByBdPO1bTcNzO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":827062},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta21_1694514532686_0.8055916663481297","host":"s3://npm-registry-packages"}},"0.3.0-beta22":{"name":"@neoswap/solana","version":"0.3.0-beta22","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta22","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"725c44d0ba0671eda43a99b7e38cff9b3b5de51a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta22.tgz","fileCount":182,"integrity":"sha512-+NwHn2VtVGKx3EsOGAtHF7EkhwtmIhp1QA5Akw9wRovU6F6Zu0WRytGXegOtz3hC0GeaWV0tEDyk+e1Y/dYdig==","signatures":[{"sig":"MEUCIQCQ9wS3bXph+PV48hXhcvzXFqgMW/MPb6gKcOCKdk4m9wIgIQQN1/m3DZAtww6JYEmpfkeIFISqgH85NeYzI5Vz2II=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":827522},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"bb71a44e09b1ab08696c5e2ce1b94442a9b8a46c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta22_1694514803156_0.7147843206921183","host":"s3://npm-registry-packages"}},"0.3.0-beta23":{"name":"@neoswap/solana","version":"0.3.0-beta23","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta23","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"4d15748510975ad8f8ae14874b6b804dc42cf07a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta23.tgz","fileCount":182,"integrity":"sha512-LKNDyneqjGb4ONIng/drzdZ0BHo+W6ed07ZbZ3kojDjQ+PJxSa+AV6Qi9qPB8SjDCf/qXtjn76Vo3KRkxTXqAw==","signatures":[{"sig":"MEUCIQCfX/9tv9AyhiMBtWhJLdN6pbTzHb4LkLe41zmnVqgSJwIgWraFvjOQrdrXZ7nAEHwmJuLxEZtWlKwhqpnJXCZjSag=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825866},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"508ee742b1b4b8d49be01c2d89acc72c908e6059","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta23_1694518643508_0.7886937789484074","host":"s3://npm-registry-packages"}},"0.3.0-beta24":{"name":"@neoswap/solana","version":"0.3.0-beta24","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta24","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"01350692b1d8d0c6602511722d32e22f965cc0fd","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta24.tgz","fileCount":182,"integrity":"sha512-FQhZq185jUvjitiIQ7ZCy8Eg0YTiOGDLNGpHvV0K6sYD9y5RHzPA+vwxGSngXM5R5+cKydPUXvNcsj3Ua/eqxg==","signatures":[{"sig":"MEQCIBpv2vzJlzfbU53lQzoi6saWc/Lei1Zsk/wZHvxHpE3WAiBhF4AgRodA/bKTj+2Y2LrZW4zrpIc7l1R4iyjxVbVq4w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825646},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"508ee742b1b4b8d49be01c2d89acc72c908e6059","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta24_1694524184845_0.1557783051509809","host":"s3://npm-registry-packages"}},"0.3.0-beta25":{"name":"@neoswap/solana","version":"0.3.0-beta25","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta25","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b54249b976c260a77a9ce0f81fde374287a3c208","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta25.tgz","fileCount":182,"integrity":"sha512-I63ouxlvJVmAjku/4A0jb6JV+FkmETKU3ka8AEkf+3+8Eq8xN2GjaE4OYX9klfwoFRIHoRF+Ws2s/hw7YkNAqA==","signatures":[{"sig":"MEQCIE4gk1aYaUT0VKjfOn9iP2uCwHpVjPb8m8JAbRPYqmVhAiBa8mye3cEGUfIXB8hinHABijyNdguC9X6q75hj+DLdAQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825710},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"508ee742b1b4b8d49be01c2d89acc72c908e6059","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta25_1694525003360_0.09685190157190005","host":"s3://npm-registry-packages"}},"0.3.0-beta27":{"name":"@neoswap/solana","version":"0.3.0-beta27","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta27","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"fdc3b22f3a35aa2a136aabde71d27ccd2d0c096b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta27.tgz","fileCount":182,"integrity":"sha512-Yje0O5Yc3XmYWJgVSIwPnZEyk2IhE6Qj35L3zP+mtoqL+B8vSpo3D/cd8cJcwt/rvL/H44X07UudpZyNL089Qg==","signatures":[{"sig":"MEUCIQDcN638am/AdwezNu2p50at/D9wOPJsIppGHEcyv7uUigIgOWJTGGUjDwstV37E2mH+VSiSMXI5FAAm5mkHeglHkLs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825608},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta27_1694676482160_0.6726280850774802","host":"s3://npm-registry-packages"}},"0.3.0-beta28":{"name":"@neoswap/solana","version":"0.3.0-beta28","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta28","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"14d6f7f6643c1a1a9d4d21ca8c6573f3fce96f77","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta28.tgz","fileCount":182,"integrity":"sha512-5y5/ITOmaOBfyTTWkI/zMuuqVghNvmeADd8s9Muu3sCVwgFmuwbpFl+21U5cK6f88AEf+BoSEulH/4GbuJCkTg==","signatures":[{"sig":"MEYCIQDfYS5DFINhZN/ye6Tgj2JqbDrbkXtG7gi2OPX959iVfAIhAMKwJ9zuKNE0alDki/UKtX+RtE3MUc7kwKLZ4E0hECUA","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825606},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta28_1694679208302_0.1322272753234528","host":"s3://npm-registry-packages"}},"0.3.0-beta29":{"name":"@neoswap/solana","version":"0.3.0-beta29","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta29","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"188efa4b818186ebf15f6ca61e5c7b91d1218250","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta29.tgz","fileCount":182,"integrity":"sha512-cXCxJSYyLWufQv5FwI98J3zI/49L4KMYCxuO/QdDCUjm1UPHK0VFlwh9FrRk//xxhFSq8ItcARXHzAfxYgFr6Q==","signatures":[{"sig":"MEQCIB5fQhMWcqSaWKHhs1NiXxp2+XG6yIpRSx4r5WA9jIliAiAbzDFOlTX42UYEnmuskg6S2jaHjA0AHA9sFKHLAYaS8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825542},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta29_1694692870483_0.3587465430140886","host":"s3://npm-registry-packages"}},"0.3.0-beta30":{"name":"@neoswap/solana","version":"0.3.0-beta30","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta30","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"a2cd42b92fc1051d180a89436421406943b42598","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta30.tgz","fileCount":182,"integrity":"sha512-sfHqZGseQrovp3lBYoFvKyYWr4QdZuo6PrrRNHYYcZvpKc+2oq2oYAR7ykV2XB1W4Qj4zGVrO657edgDfFlZTQ==","signatures":[{"sig":"MEUCIHmVwswCFAMrmrNM6zt94Ps0G6GpTSgBO/XDUS2isKOQAiEAiXT1cQ1Ifuh/Vx9jmXHei0QwAmCcxAo8pQHaBvHIB0A=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825550},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta30_1694693132400_0.2462021767335214","host":"s3://npm-registry-packages"}},"0.3.0-beta31":{"name":"@neoswap/solana","version":"0.3.0-beta31","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta31","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"cb0a21f2d4207efbfc1c87829316aecf5892ed10","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta31.tgz","fileCount":182,"integrity":"sha512-0dSPxRCWWBfWxMqCWvHI6wh53RBKg1SPJhrldb30LAyJxBYoeMHXCNiR0UGcDwjkDkJ2UOqg2hG9moe+GdXj6g==","signatures":[{"sig":"MEUCIQDA3OeHsz98ScOk2PXaxk65EV/pdQl4ySF3kuXneXqDAgIgKzaXh3UZhaybhaneqS7Xsae/UtsCKed/zba9YBXlrg0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825564},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta31_1694697390339_0.13057589833261685","host":"s3://npm-registry-packages"}},"0.3.0-beta32":{"name":"@neoswap/solana","version":"0.3.0-beta32","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta32","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"3c77b80e4c0a8ae9a489396606f32cd2c7ce0d77","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta32.tgz","fileCount":182,"integrity":"sha512-VtCEnyXkddFDgAwaPwYeuAZcbAIfsBDO3Ft6PqJ7kpuGFCM4JBychnp0PZqMjgn6D7vqjLcphoZ86NGbvsTVHA==","signatures":[{"sig":"MEYCIQDtGc/dPf+YGSjZxWiHhCZty2LDJYNSck2zHWVh4hvqKwIhANg3E/o6uGQEtoK0FwR9bK7W9ng5gLWA2WoUVlAfrlom","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825564},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta32_1694697721979_0.6299577222672186","host":"s3://npm-registry-packages"}},"0.3.0-beta33":{"name":"@neoswap/solana","version":"0.3.0-beta33","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta33","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"05d76c988ba9675d9d973f5952482d5221cf19f7","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta33.tgz","fileCount":182,"integrity":"sha512-09hyqhaW0FspdcQRmZ9/g6/l1s/4mosmsGTdRbIxlgGqfDB+ztmZYBS8wQ0sYkB/LpWcXA2kijjsuwlu7ZT3gQ==","signatures":[{"sig":"MEUCIQCv4taMoHCjLXB3mVBGYfcwbCVzcesrT4W2iOEFlzm4zwIgcWJ+Hx4sNRXYiZy8VcdJYbMSdK8PFFJHK/qM1kX3y4w=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825566},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta33_1694697738335_0.39283703978289086","host":"s3://npm-registry-packages"}},"0.3.0-beta34":{"name":"@neoswap/solana","version":"0.3.0-beta34","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta34","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d35000e1179fa0488e545b23699284846c89831a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta34.tgz","fileCount":182,"integrity":"sha512-PgO/RJ4loAdFbvtfJ9Xr2jg83Pm+Pph/DVNR/pazzYXpPaF3rK9LGVRT0W6J+yFtEuqI32HUoJ1XSbCGYOvsqA==","signatures":[{"sig":"MEQCIDOghQhhKBdRzRw/G3KjYRbgLK1H6bkQ5NsAAjAHyiZoAiAft2xomLaqwz2S7M1FPoCGx89qNsR+xGFyu5i9mo6FNw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825558},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta34_1694697935377_0.3223382841464837","host":"s3://npm-registry-packages"}},"0.3.0-beta35":{"name":"@neoswap/solana","version":"0.3.0-beta35","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta35","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"7f419b50c17adee98673639463494982cf33ee36","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta35.tgz","fileCount":182,"integrity":"sha512-sYeu7SmEm3zdW2pc5EYmVKWIbg16S4qp0T59ZK3WqiKb7mqB6p3eTO1qRzg2zYoNiV0UJcpaBSPT9AFY+7XoYA==","signatures":[{"sig":"MEQCIC2XW/JXuyTFJS5+FJBMregNJLujb/i1Hq5uYcTPFNiXAiBqEXV0oxn8baoNGK0ler3QDqk7MKtAOOnWzIZCdoMsiw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825874},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta35_1694698192244_0.24794133909477156","host":"s3://npm-registry-packages"}},"0.3.0-beta36":{"name":"@neoswap/solana","version":"0.3.0-beta36","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta36","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0c7372b86b7ecb97163177e90f0d3ccb6ad61160","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta36.tgz","fileCount":182,"integrity":"sha512-Fa8K6BYoP9j2fYS5p2FQJ9yoGgyy7sTPTb1OucxdYBKAPd5KXGQZk0+ft3O9xUdo483CB7X+I1t0fi0uLJHskw==","signatures":[{"sig":"MEUCICdkOj9K/Vbp8g1LdsnOWejuvPJQ+xif5EC3ebvZdRS4AiEAmTz1MkNPQ7AvZBknD0xSrRoWk9r1qLJub4xcmv2PdgA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825882},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta36_1694698316081_0.8027939294714368","host":"s3://npm-registry-packages"}},"0.3.0-beta37":{"name":"@neoswap/solana","version":"0.3.0-beta37","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta37","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d1128a8ec8fb4b8823aa6cbca0f85397a63b6942","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta37.tgz","fileCount":182,"integrity":"sha512-dIAOdkzlMxdQQdVlxnaqjUw5DD44OicF5ZqpxrAYeVty4habTr86Faw3ZD2pYfmvYCgbYz7ymG3ERuhO/D5PDg==","signatures":[{"sig":"MEQCIHBU6TB0TtEq05Mi6f95c8HI+S0+z0hbISfn375e/RTiAiBfdiiTd5pWMGZINYQcsywmPnL7GjeQ0g21H+QdZR2ZhA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825704},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta37_1694698575409_0.751996226182319","host":"s3://npm-registry-packages"}},"0.3.0-beta38":{"name":"@neoswap/solana","version":"0.3.0-beta38","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta38","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"936dc85716991983265bc3b83c54c1b846af9e78","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta38.tgz","fileCount":182,"integrity":"sha512-74U2/Bq0/6oqXNV35SDA0kG1UTMaVLl6/TLONdvzxoMzGIbexfW42V3bdKEri2TUWTysXKxiHLwANrZAPnBe6A==","signatures":[{"sig":"MEUCIFKAY68n56KCXKzl/kN2zpsrbE3DLfGaALwTntVk3Jm0AiEAgurhQ3MfUKtutuJ80Xzz5mEBLqeHG7uAP+OCdvG2Iwg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825822},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta38_1694700308816_0.025077022951978334","host":"s3://npm-registry-packages"}},"0.3.0-beta39":{"name":"@neoswap/solana","version":"0.3.0-beta39","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta39","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"913d9cde49eed014d4eeec981c296ebe27579f7a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta39.tgz","fileCount":182,"integrity":"sha512-2KTXu1DC5NMcz+7FdbRWDD4GK15zaRXgXvxjQ/m8/zTl50XrJiHG9Wgs6HHrq69eG2rsxcMPw2i6kG5QPbJKeQ==","signatures":[{"sig":"MEUCIHTPebN3PcssaHzkeQWfyvNP+02DGRWXOrQr/BOqpWB2AiEAudnjGXATrPA1suR8gv/XWhGb0+/wxAvzVKFS7NREOnI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825822},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta39_1694701340632_0.10467653891381135","host":"s3://npm-registry-packages"}},"0.3.0-beta40":{"name":"@neoswap/solana","version":"0.3.0-beta40","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta40","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"700f42ebff7585e84ec386ceafcb799f3286d100","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta40.tgz","fileCount":182,"integrity":"sha512-lBFPrm2BUmLPqaaaWWKZuVRw9AsQWs7fOuwAl/+15d2perG7jKnGReabRSqEMFbZWpUuZ52RIansOo1zfQnc9w==","signatures":[{"sig":"MEUCIQD//gwsaavWO80aKj4cqzT1WDlaUIfmkdZcOBbZ23ZMKQIgGb5uLUsAJk79Cm93a3Urj3t0LkaWbi9XP6nY1NOMoDY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825814},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta40_1694701528775_0.6588098659947077","host":"s3://npm-registry-packages"}},"0.3.0-beta41":{"name":"@neoswap/solana","version":"0.3.0-beta41","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta41","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"71040348c67b49a812739aa5ec36191ada816782","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta41.tgz","fileCount":182,"integrity":"sha512-UwAz8TO8NkF/i/pV9rLH8//ujlTUCRjNw6uTI0Wwc9FI3yXlpHzBqJeqBYKIKtra1BoUP/pyS7j/yr1EfvBROw==","signatures":[{"sig":"MEUCICBjA5oT+7UVktzkrYF6kfsnYUyiVmenV9ge9c4mZjB+AiEA6EqZJ9VdyzUn8PntkBHj2/mn5ksDuALX2g5L1momo3o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825820},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta41_1694701632889_0.025541200192843005","host":"s3://npm-registry-packages"}},"0.3.0-beta42":{"name":"@neoswap/solana","version":"0.3.0-beta42","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta42","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"18c44e748cb973830d58d6f9c40b05f736db6484","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta42.tgz","fileCount":182,"integrity":"sha512-0pi3/wBcwW848PFLZiovSAaMA4vvzZhlm1T2se7BOyXkWBEz4GUonL2Do5WGxIdH4jrXRX8avUvaJUxd7SpjZg==","signatures":[{"sig":"MEUCIQC+r4K077jxFPQmPWZ9W6YNDasEij+yaR9XQFIq6YoSUgIgUZTlyYrbr0l7NLX9URwr65y2DBw7lZB9Y8+lsqP6C48=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825924},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta42_1694702201497_0.40939252869383913","host":"s3://npm-registry-packages"}},"0.3.0-beta43":{"name":"@neoswap/solana","version":"0.3.0-beta43","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta43","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ef3e35663360518536da36ab3c0d2dac8587f4bf","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta43.tgz","fileCount":182,"integrity":"sha512-2TpJfEhCEm+z9JON+4p2MRK+9Ingx7F7Jjnh8hIao47Qn5I9oeYGpfFxrb76YM9alxTCTc5W3EtNdkCxT/nR+Q==","signatures":[{"sig":"MEYCIQCAl8Uos//ghEQUXXTqRKEjGREtKx4+7Jl7nQjuWmt6tAIhAPtNCfsXCuvtcwQ3Fhi9ZGFY0znLw+GcyqB0i8ELqFKv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825964},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta43_1694702291766_0.6839732268434959","host":"s3://npm-registry-packages"}},"0.3.0-beta44":{"name":"@neoswap/solana","version":"0.3.0-beta44","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta44","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9e861bf7331a724d984d651008c21e57780d6050","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta44.tgz","fileCount":182,"integrity":"sha512-VVjYejDUFW8PJfTunUZ/rdoBv1zmp0hWVh3pe76BsB1ybxZfstuWs0EVIc+liFMWlPdD3ZhMT67h3bHPejzLcA==","signatures":[{"sig":"MEUCIH8/Pgn5d1QXtTiShXVs6tGZGd0aPMxMoVpzW2qH2oRUAiEAqS8Apmo/9sLVD81hI3rm+djzHPCIKrv9FmoulSI5IOY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825744},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta44_1694703576241_0.6237960981241677","host":"s3://npm-registry-packages"}},"0.3.0-beta45":{"name":"@neoswap/solana","version":"0.3.0-beta45","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta45","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"6cfb8ba843c1efb4c7d93a7e9c8c69317a35adee","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta45.tgz","fileCount":182,"integrity":"sha512-vnPavy8f5VjbU/Yw+KvACUNI55jWFm0b1lre9SjF/Kf6clGZWoMVLYCwfKN/DVzUAcPrvjaKSRCbhyizYte8Rg==","signatures":[{"sig":"MEUCIQC5RNta0wenllXdbbr17yuywjicI68EqTRpo9hA7mJlzQIgOcn+YBd4Zvt1sWtYDL3CjccgptD0Q/pDOzdehy8G9FU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824943},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"64cd9a235729ed5ecba349ef8a6381ccadcf76b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta45_1694704252553_0.5355358706723663","host":"s3://npm-registry-packages"}},"0.3.0-beta46":{"name":"@neoswap/solana","version":"0.3.0-beta46","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta46","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"941c7f3ef3c8510f3cef432984fa8637ca25054f","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta46.tgz","fileCount":182,"integrity":"sha512-1CuxfbTZeY/E5Qw45hGZHfeJ+zX228aaAyDJK7pR/oXhOV5GQRqYx4nGtSYEH3WtOTpSSQ2UK0XA5KdYoFtjMA==","signatures":[{"sig":"MEQCIGuykiKsN+IQIn+rQJ843Zq94ra1YwwkTa+Hlhqmjw4zAiBPVR0tslNqQYANj2vjqkKR07X8VuuStRDnQKojhO0AFA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824921},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"a5083a03c90f27f4ae7a67099073918834823d4d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta46_1694704748464_0.7851231779206405","host":"s3://npm-registry-packages"}},"0.3.0-beta47":{"name":"@neoswap/solana","version":"0.3.0-beta47","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta47","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"c74c7c1c1c269f5aa7f28380a5e2f18bc36fb587","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta47.tgz","fileCount":186,"integrity":"sha512-jZkqm0uK93DdSvH92cm7LOxCxM5VCJM28FZtdG3d0epWYq+fA0xJI8wExJL7RJpdoy600ZqASkNWJDDuyE7ciA==","signatures":[{"sig":"MEUCIEoFXQqMlrqQs5SWp1lstVpBLnHtTQJ9aklEUhCcCTg5AiEApUWEeFqDP/T+j8Slc7Kpb6NnccHOJmD//C5msE33l3Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824768},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"70d98ce65bc26384f746056e542fec3316cbee9c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta47_1694707219748_0.549306510232759","host":"s3://npm-registry-packages"}},"0.3.0-beta48":{"name":"@neoswap/solana","version":"0.3.0-beta48","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta48","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9fbc7d40e122b00fb25da186af3d04ebbc924b0d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta48.tgz","fileCount":186,"integrity":"sha512-LHawJqTJo8igGQ9O63YwkMytpAskYuLtNP4or8zX2Wr1gyR8dBHnGcCYBMTHjzmqxDlRYJlqycyQbQTKrQ4s9A==","signatures":[{"sig":"MEUCIQDTnFtFY2D4yhyJxVIWVhIL9MqsqhSyaivND1aaQXYXIgIgDEIRiQY9wUl3f49BmaYnvxbWw08eBZPUk4lATLt8SN0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":824696},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"70d98ce65bc26384f746056e542fec3316cbee9c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta48_1694707844360_0.9567219222516434","host":"s3://npm-registry-packages"}},"0.3.0-beta49":{"name":"@neoswap/solana","version":"0.3.0-beta49","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta49","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"a2ccda02f0ea7d8c7b9b443b4c858a24909b18b3","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta49.tgz","fileCount":186,"integrity":"sha512-BzrrfEfYk0AtXSQhiARpNs8h2f1TwzqQQ8i1dkpIjsUkq1XkJXmzTA21bYm+jB13etRGOrhyoe6N6qYWvYG5pA==","signatures":[{"sig":"MEQCIDNUEPDKdD29PHIWGTOcz+AgcCvVZc56xz0tRInx4TojAiBjTGPC08w8KqArbKbYAUOxbcjbpsFS+6uJ1cfll/1X7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825056},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"70d98ce65bc26384f746056e542fec3316cbee9c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta49_1694708272595_0.10677915612420374","host":"s3://npm-registry-packages"}},"0.3.0-beta50":{"name":"@neoswap/solana","version":"0.3.0-beta50","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta50","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"bf5b82cf449e8f4596507b3a127c7e208acc1693","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta50.tgz","fileCount":186,"integrity":"sha512-tex7/BvD32x2Ngfqe87KHRqhGSeZOoUARVtAV4//7nInaGasn5cSHrv2t9jKjaGCuYg1yYD81uQI9Vyf0Omu9g==","signatures":[{"sig":"MEYCIQCsovY/weo23lKZr7xtT2h2znnbPp7eI/Y0j3OgCPGRXgIhAIZbK2IQzdS3QUrZxQUC6XbtmUoiflJRllyzSqGMal/T","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825007},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"70d98ce65bc26384f746056e542fec3316cbee9c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta50_1694708375076_0.25619838841856013","host":"s3://npm-registry-packages"}},"0.3.0-beta51":{"name":"@neoswap/solana","version":"0.3.0-beta51","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta51","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"1a0ec31d6c12f009044921fc164298c318e0bd84","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta51.tgz","fileCount":186,"integrity":"sha512-t75STv6CbWBkaPYBP8+xBIoQQg+94ch8lkvR/+iH6/tci2/WZE8jCVnx4x4fjS9SW23I367fUlilPAw928Bo3A==","signatures":[{"sig":"MEUCIEctbl14Msf1cfOv3UIv0DN2gx7FZHJSzyazFcDNIc1xAiEAzq33QyNHqGSCx+8MvWeWauElRHz6mv5cYRQK20X7zQg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825109},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"70d98ce65bc26384f746056e542fec3316cbee9c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta51_1694708478770_0.102870933187035","host":"s3://npm-registry-packages"}},"0.3.0-beta52":{"name":"@neoswap/solana","version":"0.3.0-beta52","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta52","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ed8a65479c79e65b520cb9397d9b92703320ebfc","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta52.tgz","fileCount":186,"integrity":"sha512-eevQZBFBrem3yPtjoKvASWCM//DHoJaiKrQkXHGVw/31xRiDkzKAYVpf6GkydRVIFweZfq/dvIn1nuYofQKdYw==","signatures":[{"sig":"MEQCIAG516ernMGryXl8upfxFIOfYda8qgOaQYzKWHdU/+xTAiB8kVMS27zCZL6StfJaASy7TJtFbjbbO8si8YmWg2Ndqg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":825128},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"70d98ce65bc26384f746056e542fec3316cbee9c","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta52_1694708594580_0.25211068956477867","host":"s3://npm-registry-packages"}},"0.3.0-beta53":{"name":"@neoswap/solana","version":"0.3.0-beta53","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta53","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b29cf4a029d334a44cdc558ac4a7747899d03194","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta53.tgz","fileCount":182,"integrity":"sha512-ciaixzvBOR5TjSYlnOIuW4PCpb9QboolAGW4g5lyKzEROaewQ56LJBfuCwX/E2I2hqFd1QWdZZusgYaw1gxgDg==","signatures":[{"sig":"MEYCIQDCZ7Sdq/MvawYyjTIAJj0oGntRnphTiDB+4vdKVw8STAIhAJ7TR2nGyIn97Clu+/OSApZIf5oQ6tkoWqlKonRagF0z","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":821502},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta53_1694711353194_0.2778138697389243","host":"s3://npm-registry-packages"}},"0.3.0-beta54":{"name":"@neoswap/solana","version":"0.3.0-beta54","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta54","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"54b5333f866a2da9a5a0fcb0b80eefd81b8a9309","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta54.tgz","fileCount":182,"integrity":"sha512-5fGVXONjXsiBzIO4lAwnUnd1v6UHNodPik4mNYO/BpEqc2550l9xa1uxOFx+NiZ6c8zxRtdupiMwhjZRWnMdqA==","signatures":[{"sig":"MEUCIQC9SvYRedzteEYmjAxT/alBbkY4zlv2f3XeyngSmxs6QAIgZeTafJrconeKZrmQADJy8FTYsnc2ImEVzRWc7wQhGsc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":821758},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta54_1694711720254_0.23883828834795606","host":"s3://npm-registry-packages"}},"0.3.0-beta55":{"name":"@neoswap/solana","version":"0.3.0-beta55","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta55","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b14da8335b32b3977b1d3390dadd532deeb814f5","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta55.tgz","fileCount":182,"integrity":"sha512-VRf/HAyB9X+sZniv2nuhJ9dCsmFQXxFL2ava9p0mqsfXoLZqcWzxdHTgv+pDEc9m1o/jKW9bx+NtZBeuyrT7cg==","signatures":[{"sig":"MEUCIQDmuYMQycAHL7QLOzI1HOAcFJmBFMj5jjAUGWg92u0GJgIgddUjBBajroTmxiilhsvVJbz6zmRyIjQZgmA9tb5VMys=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":821786},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta55_1694712060353_0.8886265787037155","host":"s3://npm-registry-packages"}},"0.3.0-beta56":{"name":"@neoswap/solana","version":"0.3.0-beta56","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta56","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"8d1c4684ef30c1fa79f5a6e5f32fc4408f89ba31","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta56.tgz","fileCount":182,"integrity":"sha512-McnSsxOCwzSZdjUiRm31QwazXN6ByMvwDdYWuyVx8CSIq1LDSiIazYHjXzHLbrisc0hQ4IulYk6a42JJaVAd8A==","signatures":[{"sig":"MEYCIQD8oVFECHr01JRfcVoOWRi2gJZGisQNOdkHEg4zla1rcwIhAJjVFONS+zG5C918Hot5FOitXvIZF6SzF2+FX1PVBOb+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":822016},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta56_1694712457598_0.7054113495651617","host":"s3://npm-registry-packages"}},"0.3.0-beta57":{"name":"@neoswap/solana","version":"0.3.0-beta57","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta57","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"228a626cb3470510abb297caf67faa078ca86099","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta57.tgz","fileCount":92,"integrity":"sha512-2ca8MzxvjyUKsCupEAYxwLy3miqE6p2Q9bIhUKWj1DI5zhFHFLud+ocOxJZKFB/YZrnBEpWs3yFJAH/CP+0jpQ==","signatures":[{"sig":"MEYCIQDShHvTmMkOub4bwfEeWs70Q1H9ekE/sBHdFDDqhhXeoAIhAOyazcTw0z30LBVbVoX3v1J2Xq4GuvhA3Lsq4saU+xhF","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":410187},"main":"./dist/lib/es5/index.js","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta57_1694712653089_0.5821010961316901","host":"s3://npm-registry-packages"}},"0.3.0-beta58":{"name":"@neoswap/solana","version":"0.3.0-beta58","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta58","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9eab0e6ea8d77e164a5e17ab4e30e7b158f1798d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta58.tgz","fileCount":182,"integrity":"sha512-EgWn2bLucQ2dzNaNcmLKIU76yZKiF+6TQupqPMwAxL+BBzZBpR7tfutdCHvkbryJYGGc95iqesMuzhukbyFgfw==","signatures":[{"sig":"MEUCICp8WImUjAhO93swMsrvAKnqnAM8sXiyFnp/K7WIAS9ZAiEAvjvYgrRhoLpHZEm/NKSmykKMI4aYyhqOa9RGn85i9gQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":821951},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta58_1694712728501_0.7819455551167624","host":"s3://npm-registry-packages"}},"0.3.0-beta59":{"name":"@neoswap/solana","version":"0.3.0-beta59","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta59","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"231206fae2dcf19ec69cc5138ab752c4b53f2ac3","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta59.tgz","fileCount":182,"integrity":"sha512-MXdLFLJyxzPqmv6Df3eoXNIidrVkSxkUm/iRHXndNNmYdTVfTthn3IhuQxguBxGOr978Vhniq7LFAye8LI9mMA==","signatures":[{"sig":"MEQCIG9YMN+iwCM7GFRnUpURFED3zYTB4INt80bYbK3IUWSgAiALwapYmiKIIFT+HJFWVXr+rKyM7EPvZmVvQj4Vy6e/lg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":822275},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta59_1694712878175_0.172087028565183","host":"s3://npm-registry-packages"}},"0.3.0-beta60":{"name":"@neoswap/solana","version":"0.3.0-beta60","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta60","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"33d4304b7181710b62d8f8131eb8955c7ec87f8d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta60.tgz","fileCount":182,"integrity":"sha512-ntLqJJB4HZJtT22Ip3vWO/6oSjdnNB38qROj2Bjev5GA7fJEZXX3+9xVhU5CpONNOo2Bs6yYlRACzFFIXPU59Q==","signatures":[{"sig":"MEYCIQCU8NHHQGc/krrRajcByDvRTc3XhMfl23V3bTSoH8gjVwIhAOUvK2OBAkZTtfM4wvn+dRHfcX2gSaLsKSojrhmiBKL+","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":822275},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta60_1694713383820_0.8982943062939504","host":"s3://npm-registry-packages"}},"0.3.0-beta61":{"name":"@neoswap/solana","version":"0.3.0-beta61","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta61","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9ac81fdc15c7a9c080a8486f5bb03af917b62f20","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta61.tgz","fileCount":182,"integrity":"sha512-I7KYWikuPY7Uqcv3mDLTAsEaud/k9xT67dKvqrX0vN+meJRBwT/AhbTflV1Uki3HGlSxo6/7QYShF0Te0MHRKg==","signatures":[{"sig":"MEUCIDiVDXU+xeVsh+IbFCMcJ+6DdjHD443GJw5L5uhZnwfSAiEAnU/QoWqFu/OcAsAa5CHeCDlG8hgtMS6YWUg3n9qbS+g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":822016},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta61_1694713757824_0.23567106614125466","host":"s3://npm-registry-packages"}},"0.3.0-beta62":{"name":"@neoswap/solana","version":"0.3.0-beta62","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta62","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b727f9ebf65de1a2d47653ee81ce60c183a69f90","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta62.tgz","fileCount":182,"integrity":"sha512-UM7eq0vlFgea+cAwR0SgGuXPL2g/1YzU6xCG8foT+hM75EGNaHHwuTOe3yNj7yp7840WRlGoTMCfI+e/ApEGSA==","signatures":[{"sig":"MEYCIQDPfpi29EvdfByLr/6jRM7ZPF/5hp2OpmUK8mW8RnsuyAIhAI17oeXWZeItDl3Umebefcb8o4HupzUUKNrsqrTZwEUr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":821256},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta62_1694714222610_0.46884959496959056","host":"s3://npm-registry-packages"}},"0.3.0-beta63":{"name":"@neoswap/solana","version":"0.3.0-beta63","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta63","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"34d3f0cb0b3bb1af07a75638f30974227392161e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta63.tgz","fileCount":182,"integrity":"sha512-uGDLHFCrv8CmRQjx5m0IQB/uc6jKfx5ejN8rvF/O/T1IK/bdJtI/xeNbsEiZrEYG4Kl/XE8X+/5u4lhMTIaGPQ==","signatures":[{"sig":"MEYCIQDNAArgCDy3kSenqiofnsYTz2ysMAntSPdlHcR6iN9qhAIhAIIHQCy0CjKg1ee8wdRHnY8iZxe3MdCG0t6Z2oknXYu2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":821468},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta63_1694714718721_0.5399368956574238","host":"s3://npm-registry-packages"}},"0.3.0-beta64":{"name":"@neoswap/solana","version":"0.3.0-beta64","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta64","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f9903e843eb00a9046afd01fcb48eb240d0ebc19","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta64.tgz","fileCount":182,"integrity":"sha512-qF4vXjOozDWdNffZ4fJl/KenH9LbEkz5Dr2nN43ksd/JpldEy89G+4oVDT51Q9KfaXu5MjltLk6cZCwK8xVJuA==","signatures":[{"sig":"MEYCIQCbUrEPSPrsHcbE4sSATY1xng6Xs7FpjatrPbyAk4SmUwIhAM0hFjG6XNQ7v7yN+4Dkvef+Yhbr0WCxPtbdRlrJWkoL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":821490},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta64_1694714818157_0.8613305635153945","host":"s3://npm-registry-packages"}},"0.3.0-beta65":{"name":"@neoswap/solana","version":"0.3.0-beta65","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta65","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9390e16b680b38140970daba4d47fc4b4e3c2bd8","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta65.tgz","fileCount":182,"integrity":"sha512-rmOIE+X1nrqtMWx7i/chFVnqTOsu1MYt2gNcW+H+Gn9UGDukvcAPEBpKi9U/wDImmkZ8TV5K28kA06bAtAm/+Q==","signatures":[{"sig":"MEUCIQCS35ZjVW7MC2xEcdUcLOFIBdQJifs524oLnjly7pTpBgIgJk9Jbb4obw93m30LWvklUTCyVV/+wjzxOEF0SJHlmK8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":821972},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta65_1694714962237_0.390170004992928","host":"s3://npm-registry-packages"}},"0.3.0-beta66":{"name":"@neoswap/solana","version":"0.3.0-beta66","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta66","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"076f5db242ae27dedafaf00c4ad5ee9d119359bf","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta66.tgz","fileCount":182,"integrity":"sha512-QgsYHQnP6NC3UG2aOZjpnlDkKgNeyOIG6fD6QpDgM0c34t9RxvXFfX2/JqazhiV49/qAjaHrs2VDExQcU7klUA==","signatures":[{"sig":"MEQCIHG9K6syBm60mrFDELs1J1chonmAHCGcoyCzR7m0+P0LAiBy/lyfnx34Bs2LZGS7Jdj1eORH4dDlh6wuZYSSh1LexA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":822012},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta66_1694750380350_0.44322250259099216","host":"s3://npm-registry-packages"}},"0.3.0-beta67":{"name":"@neoswap/solana","version":"0.3.0-beta67","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta67","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"8ed0475a6d7dc04546326a96316bf89e4d95a1ab","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta67.tgz","fileCount":182,"integrity":"sha512-qx43LAPn0mQ3eKmlW2oWz9yiEhRz1tc+5/Mx65+AjEJhGtHlthyBZunzLUFqGrwJKUQ6rY+rcPXhi0b+9y6Urg==","signatures":[{"sig":"MEYCIQDiIZI4tf1oVjhkXdRkFbSXC82LwRM6GWi3u8Iv+zhurAIhAKBy+i2p4MVPfrPcTlAcgyJ8j7JOjXVYS7rUE+0gw8/A","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":822270},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"d5f40e4df78a10ef96d5c716f4142fd8a137424b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta67_1694750799983_0.680006248456752","host":"s3://npm-registry-packages"}},"0.3.0-beta68":{"name":"@neoswap/solana","version":"0.3.0-beta68","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta68","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"aa162f371fb0a7cab9e20f7ddb8120e76ad60121","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta68.tgz","fileCount":182,"integrity":"sha512-xzYajGA2nfw0a2d8w/Abd6ydzke47nnl1RU8DKFdW0eA+gpTRRnI0pCsCS/81CUqlJgpJXLdd/akiWPc/vb9qg==","signatures":[{"sig":"MEYCIQCYSq/0TX3a/s5L33BM9t9fFZi3q/WK97ZaMlPijBUgaQIhAOXVns8NgGRiQyPSOkXya+kgG287ZJUsCmLB/R3pbip8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":823794},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4ed04973338185f1c4b3a6fa520bca873ec0296f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta68_1694756587985_0.9934563755300307","host":"s3://npm-registry-packages"}},"0.3.0-beta69":{"name":"@neoswap/solana","version":"0.3.0-beta69","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta69","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"901721a96bfc1167f5ebd526ec0dc50bc6538fa1","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta69.tgz","fileCount":182,"integrity":"sha512-dSlDoILYGa3EXEpWiv9UilBJ+Y8tHHbpPE9OSdmaZMH1Ua8g09P78mflmpsSJg4BdsqMOaOreGVGpac3Kdz4RA==","signatures":[{"sig":"MEYCIQDMhFAqa03KrQQdzhfCnnC59go5mGzAJViMb5uoraOemAIhAL+LJXUGx0MP+eSB+LesVELfSxRpDwBqS1WllNouLBKV","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":823924},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4ed04973338185f1c4b3a6fa520bca873ec0296f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta69_1694756727185_0.21774988384372107","host":"s3://npm-registry-packages"}},"0.3.0-beta70":{"name":"@neoswap/solana","version":"0.3.0-beta70","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta70","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"3bbe4ddd4a6c6d7dd89f4a8b9e620e444579c644","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta70.tgz","fileCount":182,"integrity":"sha512-81ktClsMXeIJ9uAJqpewaGmON+FUqJ4gSrw6cYwLBq/eP1/3M7b369U32ovI1M59vcRiX7qgETQI/e23W+gwCA==","signatures":[{"sig":"MEUCIHThdFY/bxYS3sm6GhF8fDLT/n1NFBU7sdO6gcaAGUD9AiEAhgBZjG8LwQpf99Vo6+yMQBI260NA67mv6/Svn9R6AFY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":823924},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4ed04973338185f1c4b3a6fa520bca873ec0296f","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta70_1694756851111_0.6308303351635258","host":"s3://npm-registry-packages"}},"0.3.0-beta71":{"name":"@neoswap/solana","version":"0.3.0-beta71","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta71","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"e897ce9b9c6d8cb25eddcd03a366230156e436d2","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta71.tgz","fileCount":182,"integrity":"sha512-Y0RDVe+dmF+nU6a3+VxdZ9u2ty+cDNlet2XZEZzrbdOQ6f3Gk12Ovk1Z1UXIFWy8w1RLcSFYFi1A5RK7WI6E0Q==","signatures":[{"sig":"MEYCIQDfAwQJAtWz09UEdrRli/AsQ+q0c0ueCWIHXAyxpYcPDAIhAMog2LzlUMyxInQ2x6HNweDV4177XFiFipYCCKu+wo3Q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":827881},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4ccbe58c7ef72a44eed72f634eecbbc90b08e74b","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta71_1694757338791_0.8798084890389355","host":"s3://npm-registry-packages"}},"0.3.0-beta72":{"name":"@neoswap/solana","version":"0.3.0-beta72","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta72","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"8cedcd1f08a806c0c45ccae252ef6140bbd0faff","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta72.tgz","fileCount":182,"integrity":"sha512-CRKytH2Lb4W60MB0LiY2hBjQEorxCofEvO4Q5kzKe2ydiBXIVVfOa9GHPHdRloqhCGo93pRGs0A6VXzESgkFiA==","signatures":[{"sig":"MEYCIQDH3HkwdwGt0Y4oGPLaBCymYDPs6ENRIJh81IKmNjiNtwIhAOxH5mTZc3zVM8NO84E2aPHosgOSatknMY633R8Zkcdl","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834201},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"c2736b645ad5e5a642f581dd9d86b091c3872c56","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta72_1694759204464_0.9617662515100454","host":"s3://npm-registry-packages"}},"0.3.0-beta73":{"name":"@neoswap/solana","version":"0.3.0-beta73","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta73","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"e53880d3f973dfb791580eb9209479bb5ceddadc","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta73.tgz","fileCount":182,"integrity":"sha512-pc4b5fRki7NeKV5jHIHd8TvBO0g0c4/YxabmzFqrPSfd6QGAoOCk6xxctwGD8gRrOZQvNUdj1y4R92ZkOEOgcQ==","signatures":[{"sig":"MEUCIQDRIfSAvEhr+uvNSQNJEaYRjpvrQLNqckSshFfOG33uDQIgZct9ubO7BOMwkKcmyo1Yqz9L3FMTZn0i/4MgErEh8ao=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834587},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4f072633d9bca622b42e18909614255f130b987d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta73_1694759624452_0.4960503849474118","host":"s3://npm-registry-packages"}},"0.3.0-beta74":{"name":"@neoswap/solana","version":"0.3.0-beta74","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta74","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f875fb20a1bb2e1abb9e5274c59043ac8ee253b2","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta74.tgz","fileCount":182,"integrity":"sha512-bRnZEPUyKUdtlZUEsihPVV3gh+tb8bfnj90ad0TJV1iSxhxECNssdhr3u6unNrLAbwREL2+SwCYWpV+pHbulgA==","signatures":[{"sig":"MEYCIQCp8k8ef+cF5BJP8auUPkln7++muKAHcrS/BT4PVSNlMgIhANzi0O9ZwxbA2VpW4TTkV8xqfii5R2eklGnTkkAacVS6","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834611},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4f072633d9bca622b42e18909614255f130b987d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta74_1694759791495_0.368739295792365","host":"s3://npm-registry-packages"}},"0.3.0-beta75":{"name":"@neoswap/solana","version":"0.3.0-beta75","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta75","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d1b3e3a630744c6f8d6f11e41e5fa55358f7ba39","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta75.tgz","fileCount":92,"integrity":"sha512-rbR1aDMBNnKP2Pb5Tlk6aAClpmoxfY0CzdDDGczCWfyZhh4CGAgrQI+7kFI15JD50NQ9JunSge8OPVhlYaG3OA==","signatures":[{"sig":"MEUCID3+TO87DxBLlAiRhSeO3OKKeL3lFZn0WBaMLzelBMkiAiEAs1ky08xPiYlqaXUH+guiO7VRA9K0wM9yWEMaRfrLcuQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":416476},"main":"./dist/lib/es5/index.js","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4f072633d9bca622b42e18909614255f130b987d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta75_1694760721743_0.9196671732421711","host":"s3://npm-registry-packages"}},"0.3.0-beta77":{"name":"@neoswap/solana","version":"0.3.0-beta77","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta77","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"8bc505d00356ab13ecaa8e6338761cdfc037044b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta77.tgz","fileCount":182,"integrity":"sha512-CidH0JEznp6tADMJowO8QhEe0tdYtuqT1aFq/JbuEuqHNpZxGXoXQYhj1PfBhZ+ub1ZO0ec5y5fbydZDLDj7jA==","signatures":[{"sig":"MEQCICV3P3qqYGXQHZTh64QSsbqmUftDo51im4uz9bENG3jJAiB6FStG3uKPW/o5YBYOM15WE8N6Fci6IYryK8J2Tn8iEQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834775},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4f072633d9bca622b42e18909614255f130b987d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta77_1694760849834_0.4275706640479582","host":"s3://npm-registry-packages"}},"0.3.0-beta78":{"name":"@neoswap/solana","version":"0.3.0-beta78","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta78","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"6cc950c2ca44f4fd3d545bebf9a492b9b226f518","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta78.tgz","fileCount":182,"integrity":"sha512-F8qtIZArb7ViKYd4g+H3Rss9YyxQC6adhGmfQXh5WIfhCxUQkmGSi/3+3Gy9Cm53o90PiW+YPB2g2YcWbNOyQw==","signatures":[{"sig":"MEYCIQCsCgvdhnhs4HFasyOdO6teULbg4Is0k+7So4VxeP8IogIhAO3B8JDpyi4JllVN5E2ZuAy3R/s87+pvwUkvIAnhzQyr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834943},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4f072633d9bca622b42e18909614255f130b987d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta78_1694761071126_0.3839049334599336","host":"s3://npm-registry-packages"}},"0.3.0-beta79":{"name":"@neoswap/solana","version":"0.3.0-beta79","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta79","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d73c076e5ff1de99e0f014fb7cf54552218de45f","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta79.tgz","fileCount":182,"integrity":"sha512-ZYvzFDKMONoLCNIGcePjcmPjjMyqR3L2QQ6guTSvJNjeNkvAuNn1NvmgffjFG3idrHSTpopHfidFCuYOTH09lQ==","signatures":[{"sig":"MEUCIQCU9FtyOxltw3JyhIphQAea8HhRfPo8e7Axfz9r8xCqfwIgBftf4FssHpun8N69kku1CSctnq1Q/4azy6CdtQX/z0Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834943},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4f072633d9bca622b42e18909614255f130b987d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta79_1694761332001_0.3913397586802474","host":"s3://npm-registry-packages"}},"0.3.0-beta80":{"name":"@neoswap/solana","version":"0.3.0-beta80","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta80","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"a875fb59c6c594a174cc9a490ec5a02708c32e01","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta80.tgz","fileCount":182,"integrity":"sha512-UBoc+h4x6TI17RBIxu0EnkDh6XxG5+CwWOx1GQiU+74O/n/hSyoyC8jm+DRFXsic9ismARep8EAsFragosk7sg==","signatures":[{"sig":"MEUCIQD0YeBeR75readilqMWdhroJEm5xi2Z6s2OVg90rccdzAIgVxzbdLysc4/cKqZYUmQH6vv/i5AB9p1t7cGHZs0V8to=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834943},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4f072633d9bca622b42e18909614255f130b987d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta80_1694761405843_0.007495200487497522","host":"s3://npm-registry-packages"}},"0.3.0-beta81":{"name":"@neoswap/solana","version":"0.3.0-beta81","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta81","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f7dbfe16066e713025f2980793b7b8256f046f85","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta81.tgz","fileCount":182,"integrity":"sha512-BpxofZ+GTR/4PHFiIBhFdpaupq4ggMlJfL+tltcyRG7OCCJxx8eyPW9LUfuOxgfXzckfFfvTYJxWwGmsTUyExg==","signatures":[{"sig":"MEQCIHYBjvgQFpKrj6YZUBUj7VLTixhqqYYos3zEBOgv6wRwAiBBMbBdLB+KXz2JzA9YzoBZndAz3bIwn9QhZw3Lv1hgkg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":834985},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Types\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nswapInfo represents the data of the swap in a better readable way\n\n\nSwapData represents the data of the swap in the program\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isNft: boolean;\n    mint: PublicKey;\n    amount: BN;\n    owner: PublicKey;\n    destinary: PublicKey;\n    status: number;\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```\n    userNftToDeposit: NftSwapItem[] | undefined;\n    userNftDeposited: NftSwapItem[] | undefined;\n\n    userNftToReceive: NftSwapItem[] | undefined;\n    userNftReceived: NftSwapItem[] | undefined;\n\n    userNftCancelled: NftSwapItem[] | undefined;\n    userSolCancelled: NftSwapItem[] | undefined;\n\n    userSolToDeposit: NftSwapItem[] | undefined;\n    userSolDeposited: NftSwapItem[] | undefined;\n    userSolToClaim: NftSwapItem[] | undefined;\n    userSolClaimed: NftSwapItem[] | undefined;\n```\n\n## Create Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapPublicId: string, // IdentityString of the Swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapData: neoTypes.swapData, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Deposit Swap\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\nCan only be cancelled when swap is in the state TradeStatus.WaitingToDeposit (1)\n\nIf the signer is the Initializer, it will cancel all remaining items and close the PDA\n\nIf signer is User, it will cancel his item ancd change the swap state to TradeStatus.Canceling (100)\n\n### With signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"4f072633d9bca622b42e18909614255f130b987d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta81_1694761621286_0.8077913215899957","host":"s3://npm-registry-packages"}},"0.3.0-beta83":{"name":"@neoswap/solana","version":"0.3.0-beta83","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta83","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"7e78528bfec56e6a7f5a6a38b34f0f377d374521","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta83.tgz","fileCount":182,"integrity":"sha512-fLge662tdj3gSvJLD+qOESR7xqSUF5Drq9YKi3jo/1V7HtTkFWYDlePy8ia5AV8JrEQViQnH8hCLM0aWQbfBpg==","signatures":[{"sig":"MEQCIEGqTBFiGOf1SxjgKOmW1LWoLJMGVjL+Mm2zd/bExrrhAiAujb5V9lIgL76Of0W2wYMNN0oObaOoK00i+2YKwaCVmA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":844288},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"929f6da00c97b62717f71bca4397cef5d99cdd1a","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta83_1694783332060_0.007755085329896438","host":"s3://npm-registry-packages"}},"0.3.0-beta85":{"name":"@neoswap/solana","version":"0.3.0-beta85","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta85","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"1682b0ccbd7bbe67d12d08ce87bd5d545e11c9d3","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta85.tgz","fileCount":182,"integrity":"sha512-z0UHj2mpLA7ZPpgaiArXZn6Wq9lIoq8bJByM/vLCDkuQ9FMU4LEfSwmIqX5FmMbavHJm2nULfGo4jr4DurDy2A==","signatures":[{"sig":"MEYCIQDoXFo2nZIuRhAqQT5Lq0GJRB83T1Q2jvRcq5Iih0qvrwIhAJ1un0QFl6VC2cu1gr7HjDu9PIsUUNUKYm0SB1+3/qfj","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858110},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"fc28338ddb3c377702e34d3239f2d94d932b2629","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta85_1695112633509_0.840903916890154","host":"s3://npm-registry-packages"}},"0.3.0-beta86":{"name":"@neoswap/solana","version":"0.3.0-beta86","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta86","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"2c4c7a83ecdaba40910d9140e221d9e7697b6924","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta86.tgz","fileCount":182,"integrity":"sha512-Gwl5zGW1BUOvMFNRGbVgzlhBhsHogio5xjhWxc6+gUpK7XaOsXSuQYaPAxR22pyC+4d79v46aanR4bOUKqvnLg==","signatures":[{"sig":"MEYCIQC/Jlcz82m8qrcz2LSI3f1qo1LZo2g/yNgIUKYXjPlZLQIhALQpJbw5oh/FlLTezBaL9Zbeq/kCXSnGJB6GzHMZVWmZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858110},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"fc28338ddb3c377702e34d3239f2d94d932b2629","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.4","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta86_1695124398645_0.8226200346881196","host":"s3://npm-registry-packages"}},"0.3.0-beta87":{"name":"@neoswap/solana","version":"0.3.0-beta87","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta87","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"65932eec9ada7a6c5cc3bc70ca14b92e013132f8","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta87.tgz","fileCount":182,"integrity":"sha512-LpXRVQP2yOI7TcFtkr3ZPtKADT+CByPOQ9Vw/dfYyzlQi3VJBvF3xe0jAYeh2a/4Jw6pKPpn4QujEQb9hvCZzg==","signatures":[{"sig":"MEUCIHAlRQ6DUDJ2UG2s10QbP7hK/9qyO+tCTCezFrCdZtf2AiEA44/V9EHpNu4LLNkybeMdrkTPphH7tfJ4MNlC1xS7kgg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858110},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"fc28338ddb3c377702e34d3239f2d94d932b2629","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^1.0.1","@metaplex-foundation/mpl-token-metadata":"^2.13.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta87_1695127720645_0.090001728594169","host":"s3://npm-registry-packages"}},"0.3.0-beta88":{"name":"@neoswap/solana","version":"0.3.0-beta88","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta88","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"87d7284b8e8a84e81aea410242f01e942eeb909b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta88.tgz","fileCount":182,"integrity":"sha512-B5Ts4foZ7+4ftR19ngrbSZ17NRttiIVBRqjTqN+W50t6hyc3hOjo1PRAWEsaE+plW6Qnng4buLsswVafIfHkYQ==","signatures":[{"sig":"MEUCIQDx0fLHxt+yaWpvFL55Y3OTaj6Hvq/yAuvqfBFM67d+AAIgfNXCLKnsp38wksTXILHgLbUp7iExzfr/KROEdCdr8SE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":858095},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"fc28338ddb3c377702e34d3239f2d94d932b2629","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta88_1695128332766_0.12791160383032119","host":"s3://npm-registry-packages"}},"0.3.0-beta89":{"name":"@neoswap/solana","version":"0.3.0-beta89","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta89","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"566cc1d27fa4fed0b49b6869fd78d3463e442eaa","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta89.tgz","fileCount":186,"integrity":"sha512-h+bdxgVw65HNEorFmuHR7u/ZVdMEhEVqA5R+wb3DzIKEbfwMQ0ZtyNSeU/tmb/s6c/UREjeZ/6xLHz24WeP4VA==","signatures":[{"sig":"MEUCIQCp64VEubqTnbjZGXMIg2NKZPWFWDFSl7JGV2d/sFi3PwIgH+eqCRvu/E9FJ3iy1NveZsPx7sSCBshHx5qh28NoaTA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":852796},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"fc28338ddb3c377702e34d3239f2d94d932b2629","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^3.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta89_1695129965555_0.3030484401576141","host":"s3://npm-registry-packages"}},"0.3.0-beta90":{"name":"@neoswap/solana","version":"0.3.0-beta90","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta90","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"04755adab4fe945cf975bba88a294158ac8a887f","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta90.tgz","fileCount":182,"integrity":"sha512-wJN830Ih3jdbz6INZ3MySm4v1uZ0y/wq6ZQiH++5/CQSHoZlCtjXAx/XUqrVff5b6OyRLDZaSrQ1UKODbbjoNA==","signatures":[{"sig":"MEYCIQCD1/4mhcC//IoC2CVS8LkCOtGgY2VSfGTkzQPEy+8S8gIhAP6qL0VNSexUcBcDw2ZqRJTMrKq1XuZ/puqyqmB1FIWW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855974},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"fc28338ddb3c377702e34d3239f2d94d932b2629","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^3.0.0-alpha.27"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta90_1695130452638_0.5390415072516122","host":"s3://npm-registry-packages"}},"0.3.0-beta91":{"name":"@neoswap/solana","version":"0.3.0-beta91","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta91","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ef2a81a35275fb4c611d440e64cd1bd439925e90","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta91.tgz","fileCount":182,"integrity":"sha512-BSvyiOGdhQOA3raxO6/xwfjXPDnZtO9SErUIYSRBuuFirRXrwPyCIrCIVnCIKLhvlq0ckINbVQRlOaCBx6zmlw==","signatures":[{"sig":"MEUCIBLfHgU12IRISiFtDc4SMU7o4CwET6PwvZXrAiSYmgaXAiEAleyDR1nxDjfAxko8y/EpdA9IzpUC+/3R2aAEkhKYNjI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":856025},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"fc28338ddb3c377702e34d3239f2d94d932b2629","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta91_1695133260311_0.9425812859627196","host":"s3://npm-registry-packages"}},"0.3.0-beta92":{"name":"@neoswap/solana","version":"0.3.0-beta92","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta92","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"197cc2a1d44151f99d92c73f92b32ce708686566","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta92.tgz","fileCount":182,"integrity":"sha512-dMGYZoN9qCbNYC/71y7x6PSRXvz4rCGXAXLJiesTbOIg8ugzf4lcziro0iH7mtHxWwjlAY3SVl+PcEFcuL+bRw==","signatures":[{"sig":"MEUCIFKj2rTu5r5ZtTqFw9VIodk5J1yDJO1d8JVD1FgfSb9nAiEAzUtxQVrCe3DjzuhIlv2tGGcwkkp4Lf6KWMES3+0nDvg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":855105},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"fc28338ddb3c377702e34d3239f2d94d932b2629","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta92_1695140280125_0.884823736985695","host":"s3://npm-registry-packages"}},"0.3.0-beta93":{"name":"@neoswap/solana","version":"0.3.0-beta93","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0-beta93","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d9a3289dce9ff9c498c82d75a8a24b35411b6e29","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0-beta93.tgz","fileCount":182,"integrity":"sha512-IKCccY/np0/MLdvS9lsqf9FdIjIdmZwjsCW72im5VdBai1C0uw7mHKj+yJviYWmhsaB6TOP4PPcl65F8bn2hPA==","signatures":[{"sig":"MEYCIQDOOKE3lxUJ6B05vLb3mnqANwqxFvbqSyLkUTEXmvVeYAIhAOA03/yHqWrpHca3i7mjk+AcQoFhs+cIGsMLCMc1VMk4","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":849828},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"71b0a478a057df4f579819a684384a84ad6e9493","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0-beta93_1695298389234_0.9363782803302279","host":"s3://npm-registry-packages"}},"0.3.0":{"name":"@neoswap/solana","version":"0.3.0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d30af095564b38bee32658a7ba1a7d177d3c225f","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.0.tgz","fileCount":182,"integrity":"sha512-y2qNJfcLBldGKErAbUUvU5v08j8uWo2arkuYeqrkm9nIty2sl4s9fEXskK4EvCj0UkdaDIYMiBm+PrbGhwmXLw==","signatures":[{"sig":"MEUCIQDQ4ynzllyETc67IwKWc0WvaWUY0AYdlHa7FB9C1GgA2AIgMi1Q59CMrZl9PVxCsIQ0nU67iEF6CK7LTCqmJ7fpdB0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":849821},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"dc0f7151e69828a5e17faa370c1c40cb2d0624be","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.0_1695300166284_0.2962581611194204","host":"s3://npm-registry-packages"}},"0.3.1-beta0":{"name":"@neoswap/solana","version":"0.3.1-beta0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.1-beta0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"1ba9bde42d4109ee19356026e30f3e459b674782","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.1-beta0.tgz","fileCount":182,"integrity":"sha512-DjelQpiHJAKtZwTWYbU8TiU8Ygfr7zqJrJwknBSZ0sGy5Pp1GSD3223mkX9RE480H9+HR1EI7GVdwi0tspCArA==","signatures":[{"sig":"MEQCIARqFkcWA2CTTP43pQS6Tdm33t5InubpES3nhG7dWH6bAiAP7ylxGsgo/Z9iJsXhX6DemLxGGPicFZGC/sFpeK8H7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":851337},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"dc0f7151e69828a5e17faa370c1c40cb2d0624be","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.1-beta0_1695309492689_0.40473364771627995","host":"s3://npm-registry-packages"}},"0.3.1-beta1":{"name":"@neoswap/solana","version":"0.3.1-beta1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.1-beta1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0607f7dae6596de1912d53bbfbed7676753c7302","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.1-beta1.tgz","fileCount":182,"integrity":"sha512-ClbWQXNRic1RtYAGK3Z0mHzqw6zLsVacS+Iwo71TE3k8CJlYuPXYI+R8Sgry9A355cppEsEBOs+2Icg5E7sDzA==","signatures":[{"sig":"MEUCIQCGcqQheigx/Q48rBHo8kOvqfnbIFla1jo/vEPwb0YE8wIgZnTAJBxMHicN5waHoRBUoruQED3JhcYEN/EKkfhX+Gw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":851611},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"dc0f7151e69828a5e17faa370c1c40cb2d0624be","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.1-beta1_1695309757145_0.07853842980922399","host":"s3://npm-registry-packages"}},"0.3.1-beta2":{"name":"@neoswap/solana","version":"0.3.1-beta2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.1-beta2","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"c5c1d382da6186e11b886266cebef6cdbe3197eb","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.1-beta2.tgz","fileCount":182,"integrity":"sha512-mccn+FnfAx02gSPlZ0I0yEZLeZCgiL1gPTsFEbT1kyr9IaWUVDQD3/38V9PAs6PAMkvIGSqFP7bw+SASo9eUFA==","signatures":[{"sig":"MEYCIQCzp8YQR80iaUykmFGId9ixDjPy4wPqKTrhvGiFb7djjAIhAKOTkq6qX8PbC2KE9cO7BUB/LCbiVUOgOHLU/6NQEnFL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":851611},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"dc0f7151e69828a5e17faa370c1c40cb2d0624be","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.1-beta2_1695309822025_0.26374967745897493","host":"s3://npm-registry-packages"}},"0.3.1-beta3":{"name":"@neoswap/solana","version":"0.3.1-beta3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.1-beta3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0bfd31765e8da03c610d4b0fc6a4f2dea8294b9c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.1-beta3.tgz","fileCount":182,"integrity":"sha512-+gKCIayCtzPMRnupF0erAKpEA6s3VhFqClkgPv/3+K6yg350sk40copfeavpWnGEhTH0RUB3g3Stf5b31HCzsw==","signatures":[{"sig":"MEUCIQC08jvniWEag1Uw2qyaLTpOM8PFIHNuhevECGpVxhQTfAIgZMfI4i41Zl0TRg3U+3AAbc/jaJXv5b7S+qZWOgLyCA8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":851679},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"dc0f7151e69828a5e17faa370c1c40cb2d0624be","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.1-beta3_1695310417100_0.4977106201418091","host":"s3://npm-registry-packages"}},"0.3.1":{"name":"@neoswap/solana","version":"0.3.1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9d3677c104a5554e9ebd9a2c4b947c4b9e2d56ca","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.1.tgz","fileCount":182,"integrity":"sha512-Jumjc1zCQ0q2wdbRv6+vKBI4cYd3QrfFjRtTwqOM/2ODWMVXahjKpGAolgYRtynLg1gCKF7q6NJKEtJhBq/i0g==","signatures":[{"sig":"MEUCIQDxkpt9ZHdsJp/UXV8N6fiOyJv+NvDWlYTYJywtb8CoXwIgcGT+2+PabNrRyPGMAhPZXFOOsvffbtJaklqonGs/3wA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":851673},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"dc0f7151e69828a5e17faa370c1c40cb2d0624be","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.1_1695311382791_0.18801578888707104","host":"s3://npm-registry-packages"}},"0.3.2":{"name":"@neoswap/solana","version":"0.3.2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.2","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d0114cded5244eed69cfff0431056431e7de9c95","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.2.tgz","fileCount":182,"integrity":"sha512-LJZWNuiZSY+umSFvCQTo0LUB0/GrcHGFMCp7K316Fkp2WRU0YLSg1E+vzUwhyK/sZ+OXyWChWwzGSoHy5/e4qA==","signatures":[{"sig":"MEQCIFyo68PAsjGqky4ZRSutwiPRcT1RKcKvuX0uSwJe5YhzAiAyvfEIcF4ecsBumVo8+vm9Uq9pB1ADfmDcrdxaDL1nNw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":864151},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"6a74aef10d7c751811b8f797e355b74cad912956","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.2_1695633033927_0.824322743850322","host":"s3://npm-registry-packages"}},"0.3.3":{"name":"@neoswap/solana","version":"0.3.3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"2ab007e68c7d0c67bf0eb626f4db4e9b70f76d33","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.3.tgz","fileCount":182,"integrity":"sha512-nD85oVbTjY5v4iZrkt12DsK+rb3GT6Oxwnm31bGKdoR66O0agNgvgoFQooSA/qPaugOgN363tRuMBrRUUgV2gg==","signatures":[{"sig":"MEYCIQCqtDjfN8bEniPT+8o6D6Kv+HmZmiTl/bD+acgDUTnHHQIhAO9duWDpQ5cB6OHpiNqFXYG/BxXYkvQC7Oa22BUAFjaz","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":856595},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"8ab5038708db75f7efdb93e88d308849a4a07526","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.3_1695724017370_0.6476939296432713","host":"s3://npm-registry-packages"}},"0.3.4":{"name":"@neoswap/solana","version":"0.3.4","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.4","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"94aa2ff5a30dc8d3ad9d4333ff190f31c554a114","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.4.tgz","fileCount":182,"integrity":"sha512-hSeFBeBnN5Cf5hg0woe9vlMh/KNUOLuW4vXgFGBVqfL18Y7ELPc7TM9ATAXA5Qi7tzK2Y7KuJeYj5TUbZBJ/Xg==","signatures":[{"sig":"MEUCIBA0xIVB/N5QqYv+qgEt9ZcTjngdeFEVSxHeOVOGxlHwAiEA6HuemMc9ynctB6IfQmV2/6TPg6TaSQeiQ9Kie2LLRF8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870226},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"cc0e59ca9674e4dbedeea6335f6553e8f5e7d0f9","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.4_1695730242615_0.7596182843459003","host":"s3://npm-registry-packages"}},"0.3.5":{"name":"@neoswap/solana","version":"0.3.5","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.5","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"af2cf4dd796aaad3799c675af9cae9b38f779267","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.5.tgz","fileCount":182,"integrity":"sha512-HUgIc+awFofMh/rUUQNJSdRwMLNObsLyhdLLBVSVeJqZEPO8iNAjJrROFu8azyo7U9wXTtCxnb82dYG9maIr/g==","signatures":[{"sig":"MEQCIDVaufgaIEYjToU5q8KInj2jhlnNbJZldn1RwfAf3VhSAiB3jNrTqFf6W+3ywrjEMEZXQOecjzqpyjSAGN3t3ELlIA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":866196},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"9821a78f5869dd68dd3158b1a2087fb04f2812ef","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.5_1695983712915_0.3445809703677747","host":"s3://npm-registry-packages"}},"0.3.6-Beta0":{"name":"@neoswap/solana","version":"0.3.6-Beta0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"c290a6aa80083c2c2c9c9d8d44358b9eef829dd4","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta0.tgz","fileCount":182,"integrity":"sha512-qaD0Tw7LUyi13cVMBnQ10X/IbdhrZvse69CLKhBZh10S/YcDy9/grC2KM1MA0atSFKOz1CapAYgSHyoDpDZ5Mw==","signatures":[{"sig":"MEUCICynsJeiQt+9h0ph0Fgea8tW1xjH5IFkCnq/mSrE5zfrAiEAur3lR0ILpzIF+70pQ1yCOk7EDgwIcCZn8cJ8VErDEp4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867383},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta0_1697092544226_0.7241039737935469","host":"s3://npm-registry-packages"}},"0.3.6-Beta1":{"name":"@neoswap/solana","version":"0.3.6-Beta1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"219bb03447ddc8612e7c66939726390e995fb1a6","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta1.tgz","fileCount":182,"integrity":"sha512-SFQynhKrxCF+i0IW1BOA030JhCq8WfStYBYpxcL3Nuf6v6C7/EbBGjGGAchNcE/LYRyQtcxcwKGhBmG6oQHmWQ==","signatures":[{"sig":"MEUCIQCp50slmMz3qxFFZDh69f+bMGclanHZ9znoOcWoE0A3YwIgK27cCr8s1crgfoXkjC22VKSjrCAJaOYysPRE/UNkP1E=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867604},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta1_1697129774613_0.2654081020956074","host":"s3://npm-registry-packages"}},"0.3.6-Beta2":{"name":"@neoswap/solana","version":"0.3.6-Beta2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta2","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b2261dafa280f363d9ddc988d5b01e7ba76348bb","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta2.tgz","fileCount":182,"integrity":"sha512-GIB/jv862WPOUKpFCLxtzmENBI+Opo7gQFhvmhGzs+CoY/riFVESuYqBEnvTBr2hZQrH5Jre1w5VSIY6YVSYng==","signatures":[{"sig":"MEQCICkrVtYzwLGImRgPkFcyGcW2H071TmRXovQoCIPNU3muAiASF/7Hhqf1jblnqoUeLivJI+kfbk0XtTxWmQu9TrgmLQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867598},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta2_1697130784102_0.11905743798160362","host":"s3://npm-registry-packages"}},"0.3.6-Beta3":{"name":"@neoswap/solana","version":"0.3.6-Beta3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"46bff8f83cf19232b75d0d8243589981de087f8e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta3.tgz","fileCount":182,"integrity":"sha512-YmEDQZKSUyqZvb7sD/EDB4LGee1r4TB5y2YfthzxUbdeACjpYUvNXvnZwOh49MzM+XrlGR3VL+tvMtcsDye7eA==","signatures":[{"sig":"MEUCIB9qGXJ7K28eAW35fbyQibCgiJct+d+aOHYGfSkMIni9AiEA0Ce3GHmwJqaLEgV1ktOjqjNLavruXLGg1E2HVhl5mLA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":867768},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta3_1697130898251_0.3502633707644327","host":"s3://npm-registry-packages"}},"0.3.6-Beta4":{"name":"@neoswap/solana","version":"0.3.6-Beta4","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta4","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"de841abe5f39cecca5f0ef701668be80a674ffd2","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta4.tgz","fileCount":182,"integrity":"sha512-MPJRIwG8/XlpGkLKTMdAbGpJ1JHuvqNsBucwFcWEKGuHmlI3GE1ljql2nJqrjh8ibdg1FBNTQS958wCdFe51hw==","signatures":[{"sig":"MEQCIGxBcIrXHdbzo6elpDjmmdcnH5Zr7E7Jo3GhRDRY/YjlAiB6ZUmVwtBqtr9HmCkZBvX004sfieGx9hqoTxM4hrxKDg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":868516},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta4_1697131728476_0.6298226739026764","host":"s3://npm-registry-packages"}},"0.3.6-Beta5":{"name":"@neoswap/solana","version":"0.3.6-Beta5","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta5","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f17ec0ce8330bdf6d855838c1797dba7eb33c18a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta5.tgz","fileCount":182,"integrity":"sha512-kbEObvucXaGUQXpDy/3P7PoCSOApT2nMQG152pkL5sCaHmY9a1D/GLkzzTw4CId75d2g84B4bVaRzEdIHzB/ew==","signatures":[{"sig":"MEUCIH5F8R0MSkpk0Qy2DE8CEkkh4U8/Tae7lzoneCuaKkaVAiEAp9nSdGunA23LeLWRNu9xl8phU4pVxjiBBFWbBme1uws=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870144},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta5_1697132312364_0.3518532032718591","host":"s3://npm-registry-packages"}},"0.3.6-Beta6":{"name":"@neoswap/solana","version":"0.3.6-Beta6","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta6","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"3dd730f86c2db8e3376676942a3e14c0262a1531","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta6.tgz","fileCount":182,"integrity":"sha512-Rglpkdh6XamByAATE3NqWKar4r+ia+oPIubu2EgkHtGXSj/PIf1WqUPiV15ftCI9qgcibODOQJclI0wRQygjbg==","signatures":[{"sig":"MEUCICu7+z5q3KyDOHuYuk1IlQeUe1FC2B7lgIwzMr3D/DbYAiEAszD1uL/KlP3SDrrN8CjwOJDqI6Sx+giyMewhwH3baTo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870432},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta6_1697132534111_0.3617727822934298","host":"s3://npm-registry-packages"}},"0.3.6-Beta7":{"name":"@neoswap/solana","version":"0.3.6-Beta7","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta7","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0f29dc181ff384ac5f1a3a4a15573cc038662451","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta7.tgz","fileCount":182,"integrity":"sha512-e8bsDha5cWaVexbKvMWg2VVWWBqKJiAkHL4j1zHRPg3CWQc+evehKlB8ELLBurZ2MhjT4pE8hFVZXTGFAc7mYw==","signatures":[{"sig":"MEUCIQDQ+8SskCcvBCs5qMVrkgjAPYcMmLkP/v3WaLp20ix6ogIgMS8JBCYrfGuB2rtGlu4c9Q9Nm4LYPHgFKg/cZml0VhA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871310},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta7_1697133491259_0.6349590181502691","host":"s3://npm-registry-packages"}},"0.3.6-Beta8":{"name":"@neoswap/solana","version":"0.3.6-Beta8","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta8","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"8dde04dee4e64b447e04ca911b80b613aaca5f7c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta8.tgz","fileCount":182,"integrity":"sha512-Vekvtt90+gSo9J8QYb8hlJASYBcPDrWejNb0nTlOviKAvIB8hqiQLnxjltYO1q/BizXTMCqaGsu97w2LNpc3eQ==","signatures":[{"sig":"MEUCIENgbvSWAt7lkSuEF2a01PiKcxVk2hT92u4PWC7vcrT7AiEAr6vuRhLYxlKweeObmbcRC2dC0Iu1dPwfnLtUN8iOFFc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871288},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta8_1697133700300_0.715743106996839","host":"s3://npm-registry-packages"}},"0.3.6-Beta9":{"name":"@neoswap/solana","version":"0.3.6-Beta9","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta9","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0fc20b829ba30c7988c8ce02270541aa33b009a5","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta9.tgz","fileCount":182,"integrity":"sha512-wZLll94WmQz7jXZ65JyUaaFLUj0Y7GNRoTj2qQufXgu5I/jdJPKomJjeW2BrGLL0TLAX4tJRjuBGn5IQWjkAFg==","signatures":[{"sig":"MEMCIHja3UZ6T0tiJ3A6zGcYkcJrhkE1mFwqhrNcoNch3h1sAh9QCcWSPuACQ6aFkMwJs0rWKsCKa6hVopxqDdqT/OeE","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871290},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta9_1697134050197_0.8132589103436634","host":"s3://npm-registry-packages"}},"0.3.6-Beta11":{"name":"@neoswap/solana","version":"0.3.6-Beta11","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta11","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"1bd345ba97578ff910fcd3d28a52818ee5fe9fe0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta11.tgz","fileCount":182,"integrity":"sha512-6GmBMJmF2LxvNozNWCz4xI2jKr7Mu5a6MQorPM0b1vEwSvWfiPqFqvC3znuQqH3HJsyhogQ4IKjs/27yk/mC7g==","signatures":[{"sig":"MEQCIFV2x1+9qD3/l1YrXs/1rDN7WqNTf2OLrq+bHDfnjQKqAiA2xO0SjZmv3kezEI6HpPabZlA7pdVforZheH5x5aiGsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871295},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta11_1697134512126_0.2921371940687252","host":"s3://npm-registry-packages"}},"0.3.6-Beta12":{"name":"@neoswap/solana","version":"0.3.6-Beta12","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta12","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9d677831ab03868b75904d74c686eed1f28b5c4e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta12.tgz","fileCount":182,"integrity":"sha512-ivGETCwLkyIZYnU0KLdWWiZ190EPPN79ZKiUNawRCscbQSzb7NG4mnD8Oun0cYcxBnxXPGPoEWGJ5CI3iXCu5A==","signatures":[{"sig":"MEQCIGrXVltIooklrqmjGvVfDdYmiuAyeOzvL4MKXZ44nOb4AiAAgt4ZXRw0AVshv++W8GtYfKTNE44zEXQFye3LP3U33A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871684},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta12_1697134636468_0.8962005246757929","host":"s3://npm-registry-packages"}},"0.3.6-Beta13":{"name":"@neoswap/solana","version":"0.3.6-Beta13","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta13","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9cc4be48254be070c678523ddd782c274e745d64","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta13.tgz","fileCount":182,"integrity":"sha512-5qpLdavk9i9s2Ixcg1+Gga+cjLkrSlauV9pCmp8JqFgfoIpAfeQI7xGAVAeXBGkETe3JMUVEVkw+v3ieyOkQuw==","signatures":[{"sig":"MEUCIESM0ZJ71zoJMVLeSNBPrWCQknsBB/T+NJf1+2dzNmw3AiEApG0eeLU1b3kt7WPkRn5glvyY579VZVlvcYWTF8T2bxU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871947},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta13_1697134810393_0.032118651504523976","host":"s3://npm-registry-packages"}},"0.3.6-Beta14":{"name":"@neoswap/solana","version":"0.3.6-Beta14","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta14","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ee576bbd886cae4734b6503aab9e6729b57759ab","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta14.tgz","fileCount":182,"integrity":"sha512-hTSLf8WLxO7fctqhH2WUl3RuXH3/2GDiScJ5P/rmEShzzAKtCiTt8Z5G804sMQ/M1cqbbb2DqLGcc8PxPuMTHw==","signatures":[{"sig":"MEUCIG3VRFnUaTyHGrLIo9X/D5fX0EsjRzGTLXRi/F/EmI39AiEAkbcYPoMGrsNaM9e5+EVxN4aOckq31G5fXFF1LRUQAjI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871425},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.1-beta.2","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta14_1697136886784_0.23878504930950828","host":"s3://npm-registry-packages"}},"0.3.6-Beta15":{"name":"@neoswap/solana","version":"0.3.6-Beta15","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta15","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"55470c5f53838dace6fd69bcbd49f99d66b5e1d1","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta15.tgz","fileCount":182,"integrity":"sha512-/P6EMvAmDM/c7+CmlpOLkp9NNNrCLv6Xm1TnNedORNTiZ1qXA+4IYdND6gPrClzKfI8IYO17UBb8lfMJh3ix6Q==","signatures":[{"sig":"MEUCIE5yD+Odu3r4JsxvISX8Rp08RVHxC9VBtm/D5SqzPiFlAiEA6HjhBfJFdIS8fqWOOM8ICuK5j4Xte05jqVSUG0Pz3W8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871418},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta15_1697140714832_0.3415112671002061","host":"s3://npm-registry-packages"}},"0.3.6-Beta16":{"name":"@neoswap/solana","version":"0.3.6-Beta16","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta16","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"7e138a270ed68a4b27e44d9f74ed12236406c745","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta16.tgz","fileCount":182,"integrity":"sha512-rTw3vwPyFVYJTmfZJI38CUprn3619ZdJw5eGkI4p8obr7vS0+KpSLvKvQjjgUOzspT8R381KiMBPW+2Vl76dRw==","signatures":[{"sig":"MEUCIA9xReDVVnEvW7mCdruqtBgYAfhYBNEfetQoyboXQWy5AiEA11H4tcedG0cOPbB9+GxjGR6a7oK/+A1VWMY3hRfR6Jo=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871440},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta16_1697144837985_0.28142174395700326","host":"s3://npm-registry-packages"}},"0.3.6-Beta17":{"name":"@neoswap/solana","version":"0.3.6-Beta17","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta17","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"356b275d61cde8e903b38236a3dcee2caeea7c27","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta17.tgz","fileCount":182,"integrity":"sha512-gMs0zCdNhz3BlmyN7gL3w/W13PVn0tjBLRCJAU4tLNOLn1VaHHzg7h0DvyUTM/E+FDLEPsYSUcLT1+2xD5dL5w==","signatures":[{"sig":"MEUCIQCzczAYMGzfbYaf/g+9APdYrJYMRdSb4hUrwo2dDz8MnwIgTmwqujrQOwZge4ua5nLEx+B6+FC0InBm542ywsk9Pe8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871640},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"95b9da965164bb7c1428cfa911753182e523434d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta17_1697148568238_0.04393357536183373","host":"s3://npm-registry-packages"}},"0.3.6-Beta18":{"name":"@neoswap/solana","version":"0.3.6-Beta18","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta18","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"92ea599ac33c011a7617a18223e2b8128edf44f7","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta18.tgz","fileCount":182,"integrity":"sha512-e5WBTeqMD/Zd2raTnPKhpnO7QxNeVhsDCZIDWcsAdbnzaMqfCXsXCyadqOiDyQ5lOPNrVy2qrY6MX9Dm2dIfWQ==","signatures":[{"sig":"MEUCIEsHr/EiNm5PLxUv3DvD7/iaoNV9KjYrhr1q3OXIxaYBAiEAhuK70nkqvPYkEDgdnPNzOfFIT/3x+wcQqg7NlZSEtP4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870260},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta18_1697508397748_0.40677118992846983","host":"s3://npm-registry-packages"}},"0.3.6-Beta19":{"name":"@neoswap/solana","version":"0.3.6-Beta19","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta19","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"4cb9436535e43bb510037d12cf5df5a5007d0fce","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta19.tgz","fileCount":182,"integrity":"sha512-szswbblaFlG7JA4STEdSI2xDSS7tjT0DGnJzQb9IbgMf5W+e1tpdOdHqF/kE7gCH3L8kc9OIdlaMNgGHLZXTuw==","signatures":[{"sig":"MEUCIChOdcn/LzXxk31EyW4T7tk53ow0rJZV8/y/5ZHLJv46AiEAtf9drodKdvcgX9nx+l3mwnRZ3CmKwYy0Bnsr6HyFkkY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870570},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta19_1697508742585_0.33237856312597724","host":"s3://npm-registry-packages"}},"0.3.6-Beta20":{"name":"@neoswap/solana","version":"0.3.6-Beta20","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta20","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"114518285b258aaa474bfe88527510b86a42b0cb","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta20.tgz","fileCount":182,"integrity":"sha512-6WbIqRwMJFDAbefPfy715glKUzim3CtfbZamAyHjwyPMUTtwRGoTLUzzi6KLMnq/q30hqCRiQHZUjIx737XmEA==","signatures":[{"sig":"MEUCIF2Rhc3kGIDdzRD34Z/CmUtd30HoDoUmmOpzE8Wr+pzmAiEAx9/Yj2l+hllm5iVYXaqY/O8n6HiQERdUyW3OSsJnZ44=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870700},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta20_1697508968486_0.3338407502932348","host":"s3://npm-registry-packages"}},"0.3.6-Beta21":{"name":"@neoswap/solana","version":"0.3.6-Beta21","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta21","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"50722e115212c14eaa322742eacc0b7ee782c937","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta21.tgz","fileCount":182,"integrity":"sha512-LoyFjqoLcn1reBpzbh2joqz4PEX1uJAS0YkeZOb6Z38m4EajfNgivJHPRNLD0xwyxs4+sVMT8bwxS6GEfQSz4g==","signatures":[{"sig":"MEUCIQCzP80Qcohs1+M0zPxbNtCBQwxXfUQieOIG66u6zB0UiAIgVCH4Sy7LTnIGaBxrVkWfBGeCLwW9o7Cc+bCZGY0/mwY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870708},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta21_1697520723242_0.9358411946201601","host":"s3://npm-registry-packages"}},"0.3.6-Beta22":{"name":"@neoswap/solana","version":"0.3.6-Beta22","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta22","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"5f533cb5012f877f3dc7d3520617f1c416791b52","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta22.tgz","fileCount":182,"integrity":"sha512-z16qxBxI/qYx5vab4ZvQ4z2f7hjVRV9xOQ/zpp52tBGxphK0t5GAVUF3ks7WWIt368zbUIUGw2oyjrSuvqi/dA==","signatures":[{"sig":"MEYCIQDzOu+IWHcK0md0GmQUgcI0n0zgymy0tP06N4Vnu1dwyAIhAI4GlOn5el+Aju52T1JU81oh+YrJ8MG3uz8RQfUK+H3q","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870708},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta22_1697520783868_0.20591155964539665","host":"s3://npm-registry-packages"}},"0.3.6-Beta23":{"name":"@neoswap/solana","version":"0.3.6-Beta23","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta23","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"528c5f219291040a9ffafdd6c4df4a0aedbc647f","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta23.tgz","fileCount":182,"integrity":"sha512-+R8LGTN2SxZADQ1QIfes3EgPz+L9zf19gJAtI+/m3QVr65ix/vbdf67LGIhDUB6y6Q0vkwsbjoJkC36FrmXc/w==","signatures":[{"sig":"MEUCIFLFL+4w7jqSNNmFKjG7d3AtOdUwBBIo9Yh58vornqWZAiEA5qMUMF8DygOTyAFZR7r/p0lwqgRjKr58bccn8UEndpg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870708},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta23_1697520940251_0.8392994343065803","host":"s3://npm-registry-packages"}},"0.3.6-Beta24":{"name":"@neoswap/solana","version":"0.3.6-Beta24","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta24","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9d6d4a842f1c09f7a9aa035933acc6cb7e0a69b8","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta24.tgz","fileCount":182,"integrity":"sha512-8UyvMxQBsh3U8XO3siaRoI+kw2uctymtSM7av+pclZpOXFyhaZy8pT35Uwc9xDFTT8gbIwBEtMGFG695s7ytEA==","signatures":[{"sig":"MEQCID3dOYygDRM2L7V0fVbRPxD6QEqjUfzf272WaO8j9prfAiBgW/VIWeoztw4/wboMGJ8vjSenNGf9UEW+HRXlE0t8fg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870708},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta24_1697521007277_0.031106398718922623","host":"s3://npm-registry-packages"}},"0.3.6-Beta25":{"name":"@neoswap/solana","version":"0.3.6-Beta25","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta25","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"503952a010b78fe379fb36a9b97b88b620fd93d7","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta25.tgz","fileCount":182,"integrity":"sha512-/77KkBog/18b/R647zVD6Sn0MwfUhHKQDFUOkAHFbQIIN295BVa4kyk7AqzRSlnS23nKh5tZ7NeTU9W20TIg3g==","signatures":[{"sig":"MEYCIQCRNX9b0nrmHTa0+9V3bMOUdQfa8rIhAaJ8TovPKv7JFwIhANf/J6oRuonUwjXcJEOdaYXp117UTOHQW3XPxCnrU7rL","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":870700},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta25_1697521055873_0.5649476504655777","host":"s3://npm-registry-packages"}},"0.3.6-Beta26":{"name":"@neoswap/solana","version":"0.3.6-Beta26","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta26","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"fa564c0bf47bd771160fc5dd4150bb39d2edb4af","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta26.tgz","fileCount":182,"integrity":"sha512-Qj0ZG1AaTjmY2XmHQlnJbx/4qJrPTlO4Au016Let+n65fL0oGnbcfDjTgUOhQLm13iSwoLF1SBExptBwzGNVGA==","signatures":[{"sig":"MEQCIFbvt/NOhVJAHi8caOL9vbSDTXH3qdAuULPNJcb+EKfhAiBg4vWffCmThMEYzo5M9cjHjmPzORFUhhKCxW4QGk2ung==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871372},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta26_1697522405585_0.05530329626951613","host":"s3://npm-registry-packages"}},"0.3.6-Beta27":{"name":"@neoswap/solana","version":"0.3.6-Beta27","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta27","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0ca83f5b80810d94855cfe41faddd11dc9745892","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta27.tgz","fileCount":182,"integrity":"sha512-uJ7RCCIoscKyk2i06/ds2mRm3Y9CFuDzJmf4PE3zmMqRiF6WAnvrDmt/vKZB3KdJTHWojiR54L286uLT2y1oPg==","signatures":[{"sig":"MEQCIDLezuFuxzoYL3S4MRvtJriqStnYbMXaCt6mN0UoVxutAiBjD0UcZrJQPfZ0Th+vxDatbtAOdEiyjBtYj2DcFgweIg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871654},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.29.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta27_1697523371829_0.4966812649277519","host":"s3://npm-registry-packages"}},"0.3.6-Beta28":{"name":"@neoswap/solana","version":"0.3.6-Beta28","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta28","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"05e245f214319982510665b1402952516db5853c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta28.tgz","fileCount":182,"integrity":"sha512-KGuIEQyD3TdlwRmBx/bgcl26PTge0DjVcZYtcxm55nly0z31x5cSu8UgF2wvBvYiwYdX+mP+2ui6CI7nwucpoA==","signatures":[{"sig":"MEUCIAwnvnTATR8Pnav3m5Jf/4UoTLYoNoPse5s5pT4XsQlAAiEA3keU2fj8SnHYogLjNpoobaoljyYOmU+XLXgd19BQYDw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871654},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.29.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta28_1697523658182_0.5161408527598783","host":"s3://npm-registry-packages"}},"0.3.6-Beta29":{"name":"@neoswap/solana","version":"0.3.6-Beta29","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta29","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"931c18c2db83f7f61bdd2453f09874491521bd10","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta29.tgz","fileCount":182,"integrity":"sha512-K20hEsI3n7grwXLR7hJ8KYPPIi4UtpDQs0vdK07ryCTzQcIjLfKNQwzBFl3ikwbC+zQFA0bHuxcBGp41Jzncbg==","signatures":[{"sig":"MEYCIQC0sf6RjCPnpOHvNBaYi93LJJjsTYE5X9zSOQdjq6aZpwIhAPQ8tguo1/CvwxAqtjo/hu116nc7MrurKoTOqsbI8o3c","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":871654},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.29.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta29_1697523710447_0.598802950157463","host":"s3://npm-registry-packages"}},"0.3.6-Beta30":{"name":"@neoswap/solana","version":"0.3.6-Beta30","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta30","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"c968a9835083c930afedd0f83f90afe77ef7f636","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta30.tgz","fileCount":182,"integrity":"sha512-rHGxwGWTECtweipdel3+VWaqk+br9YLCx29uCWXJdq15jMuLyanYhtavAwKmm4nh3ABlQKQKY8E/jKGCsME6tQ==","signatures":[{"sig":"MEUCICxMiCOeFPZL3HmFXNg3crtzUDcSNMG+8tNFBl1r7vp0AiEAlpfjAJM44XiZ4/w3eAC947zk9G9PVNSF0DcojjkT4mw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872018},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.29.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta30_1697524191832_0.8668181035974845","host":"s3://npm-registry-packages"}},"0.3.6-Beta31":{"name":"@neoswap/solana","version":"0.3.6-Beta31","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta31","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f09f7f64e38f1e93f712b94216acdf1803e11fd0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta31.tgz","fileCount":182,"integrity":"sha512-ccXYe6Rq+rlxJxQB4sVLV4lJCCdW8uthV6UZvt12ch98ZAplztF45vRaONEf7J1utywTxcUC3AEBSokj/Mle7g==","signatures":[{"sig":"MEQCICX0NPtactKwPt7VQdCvZfD9/3RCif61B4phFcxDkdBCAiBZUgAScPQ7qPAuw0KzNelfAL6MHLn0Neeer0D5VpHLPQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872010},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.29.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta31_1697524248102_0.8853627670916893","host":"s3://npm-registry-packages"}},"0.3.6-Beta32":{"name":"@neoswap/solana","version":"0.3.6-Beta32","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta32","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"334e6814965ab7c19bb649c0a0167abc4950c3c4","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta32.tgz","fileCount":182,"integrity":"sha512-UnC0S9TfaklsjLtKT96xxGOXzrFmI1+dwb4dPmtvH/8wKY/NZsd6/OHyRnYXLrIEZONE2scTsTLnMY/5rHwfbw==","signatures":[{"sig":"MEQCIGNMdMXwelU6SNYidRP6DfIUF3xMFKZE5H1hAY5JAZAIAiAcIUUfP2Qn1tvKdEjieO7xjpeetQYa/hDc7Biq0g1Hsw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872018},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.29.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta32_1697524424394_0.7386650757505269","host":"s3://npm-registry-packages"}},"0.3.6-Beta33":{"name":"@neoswap/solana","version":"0.3.6-Beta33","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta33","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0eb679f63e7742e920201d9766ca0c389e98718e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta33.tgz","fileCount":182,"integrity":"sha512-00l7I/Hfe0eudxLmV5qj1pjozdFpoBAF1pOfryS0aqQurifPo1zyi0vV8U6eYJi6X5DG+Ptg+hMQQ46ieCmY+A==","signatures":[{"sig":"MEUCIDa52imU2a4x4jnA+t0LM4fVmK1ISoPvPWfgaVMHEQBZAiEA5PwisyasFaxvIBTJBuL6CluwiV8j9vg+57U/SgMKHVU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872103},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.29.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta33_1697524531548_0.8928080851404077","host":"s3://npm-registry-packages"}},"0.3.6-Beta34":{"name":"@neoswap/solana","version":"0.3.6-Beta34","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta34","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"a541e230405de6c55fb804c0bb63a582e89540b1","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta34.tgz","fileCount":182,"integrity":"sha512-CYicEAWxHPmR0UT/hSI6OkAOdcPaTb5YhdsMnIRySfLHir+mV17B3Xo/2koBL/ovk2v6A4alCqN0wNgm9IG+iQ==","signatures":[{"sig":"MEUCIBx8N4Hu0KA2F+YH8TAc75eOFZWaqEwnIHyNgtvR1WJGAiEAurQ8BL9hJgdQOGZFUFcdrksj0Y9tciyX0JTfvPiByFg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872103},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.29.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta34_1697525070670_0.311993622597198","host":"s3://npm-registry-packages"}},"0.3.6-Beta35":{"name":"@neoswap/solana","version":"0.3.6-Beta35","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta35","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"9e3f61f1d303661058971572598db617a34e0a46","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta35.tgz","fileCount":182,"integrity":"sha512-MoEqx1X/CO9F2hvZehETUprmuCHiVMPM7wgtj5e5/YcYjlCbMuawoZk7+zpzbTDFtWnUxbEsfMEdD9hyFx8kug==","signatures":[{"sig":"MEUCIDxJu6ANtsWGxyMpDTsfARFVV3f4Avz6Ml9vKxt8OA8dAiEA4rEzGuL7DlGeWwZPMdWrS0QW/4+hDWWcfwFy2Te2NQY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872111},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.29.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta35_1697525091906_0.45304526107043275","host":"s3://npm-registry-packages"}},"0.3.6-Beta36":{"name":"@neoswap/solana","version":"0.3.6-Beta36","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta36","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0809167aaf6ee10bd5ba1cc329c41fdc84f8ec76","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta36.tgz","fileCount":182,"integrity":"sha512-6REQVu9jI+OPtXDXR7p1FrAHSdIlFGoJao5244v3b+zz8RwEVADw6XYKDtVBeevU733i06gGfweHcUU/E1Mvnw==","signatures":[{"sig":"MEUCIGHopGnOt6wg6ZX/xp+Sow6l04DGK2Ryeh9gv8q+eRB9AiEAp/vET+yaYD3WIGs3t/Si8TivlI83W9CBrCfg2AvJYpA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872125},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.29.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta36_1697525262536_0.8144446215231065","host":"s3://npm-registry-packages"}},"0.3.6-Beta37":{"name":"@neoswap/solana","version":"0.3.6-Beta37","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta37","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f39984928a923207198c57a48277793df3c5b4ed","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta37.tgz","fileCount":182,"integrity":"sha512-UiFHWb2Y9uP4tDpo/npp8QCH4dB11uCkKrB02iOAiietaiIji/AFYWTYIVYCWwQq9JNbdp2aUjw3KzIKEQ1ZCw==","signatures":[{"sig":"MEYCIQDZmXGXSPEIk84xR0oEaO8dSBDSMwiQv6owdiVWubWNaAIhAJG9DTtQPtzt4XFw+T1LO58efSqTAyRXaan0ASFVyvZv","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872125},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta37_1697525408719_0.3604618429861084","host":"s3://npm-registry-packages"}},"0.3.6-Beta38":{"name":"@neoswap/solana","version":"0.3.6-Beta38","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta38","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"1e15c1282f6aeb87e5d55996fdd2038d5f75257c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta38.tgz","fileCount":182,"integrity":"sha512-APdTEGl/iEj12CmyAoWDWiCicKazHIr6UTotgQ60t9vLdjDvnVA9E1+uLSS6T9A0Cno6PzQyPi7XbQkd5r7wrQ==","signatures":[{"sig":"MEQCIEmXfcU3giMoRejKh5U6iSmLboWRW9KI/yzXv+tFXp3lAiAqpDrjGw1/HF8L+R1edZhlOOTHKAR2BcZ04NlSJ9VSfQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872071},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta38_1697540457191_0.8505700429637004","host":"s3://npm-registry-packages"}},"0.3.6-Beta39":{"name":"@neoswap/solana","version":"0.3.6-Beta39","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6-Beta39","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"6cbbd678103e9d7d58c852ae60ab95a8ae46be49","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6-Beta39.tgz","fileCount":182,"integrity":"sha512-LvfN2sH3RyIWKhtvyBeIZj/Sil2lzcnOEm+dD54QOHBBBm1JRRRooPtxu9utyCdDfzm2foHrxRX5ZvLEfspjQw==","signatures":[{"sig":"MEYCIQCkJYfktIzsV5llJQRtoXxfdxoArqUGbfB3OezJfpqZ6gIhAL7xWM18QmuMgNwJ+j//pw1K1ew2KetdOgabVB37OaOh","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872079},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6-Beta39_1697540981220_0.9375505358552048","host":"s3://npm-registry-packages"}},"0.3.6":{"name":"@neoswap/solana","version":"0.3.6","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.6","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"bfec8744c4a617849b828d169b2e026264b6e8eb","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.6.tgz","fileCount":182,"integrity":"sha512-eJpqHWkzicwbYaudR3wPZ5QcVAYitwBk39fqu3bcBQSHB+GaM19UMZidkGkW6c0iIiVMprPJylrGpJZ4C/sGGw==","signatures":[{"sig":"MEUCIQDJKTmlDgsvitHuvJfMMjFMlkf2NatKRnYAZJmKgow3lQIgB2gWbE3YrisCTXv8WE4UfhKPwut9DT2JVmabPCyXyYU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872072},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"05ac889e9ef7ad72bb361ad587a8f37fa9df93bb","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.6_1697684420847_0.7716629664379286","host":"s3://npm-registry-packages"}},"0.3.7-beta0":{"name":"@neoswap/solana","version":"0.3.7-beta0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"fa1f0a7b6e4160c95016f252be792c3cf5ef7995","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta0.tgz","fileCount":190,"integrity":"sha512-EX6x0cSnpXu8GKYSCgpQ5DDBCxjuLIt/7s1R50qXcNrDApeI1qGru5dC58qaymHVhDigXwO3i+PbTFC+OBlIgQ==","signatures":[{"sig":"MEYCIQC9F/RijVhHUP6H7nrohmeOdRw/d79ACU0sUUWmUf/GDQIhAKqW9wrsADTubRMhdqI+zcISDqBkYUsrhuvlvL0n5ikZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":953111},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta0_1698242817205_0.9951489741309458","host":"s3://npm-registry-packages"}},"0.3.7-beta1":{"name":"@neoswap/solana","version":"0.3.7-beta1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b20b8f78b44ea0170c5c646e7bcfd039040407e5","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta1.tgz","fileCount":214,"integrity":"sha512-zXlY0yHxj8yVkwla+CZkKrw8lLKJ4XJOjlt3sxZtq4G13EJNIpkk0rTzpmi/QfwL1Rpj0kHGL1Y413o3c/KddA==","signatures":[{"sig":"MEUCIQC9jOlrWrxIg4gOuF1za5Z5sslL5J81DzJldKEYsLxxYAIgJsrK/YVwVQD1RDRAsVsvsYB7EGKfcaUu3nUlMAhNfBY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1031060},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta1_1698250807533_0.9881239957855739","host":"s3://npm-registry-packages"}},"0.3.7-beta2":{"name":"@neoswap/solana","version":"0.3.7-beta2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta2","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"130b461bc0b43bc943f7adb9f9f199b4687694a7","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta2.tgz","fileCount":214,"integrity":"sha512-trvHKA++KPQnD0pzHtfpQYTQuCOsqYj/mzcHvZBqrHaR1+w4iK9Pc6D9C4f2eVCrNY4lAiInTPDiBsfDFqOinw==","signatures":[{"sig":"MEYCIQDEAtry/YDmwvAY0EjU2PHB3oOfQw+ZMWI/yiR0njxk4wIhAKZ1brM5xLd3+u3Rgk0TgEC5YLeGSj6BhZWu9vfPtmGJ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1032394},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta2_1698290392554_0.47448091749437094","host":"s3://npm-registry-packages"}},"0.3.7-beta3":{"name":"@neoswap/solana","version":"0.3.7-beta3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d6364034c12fc520e60f82968b77d8631ad2447e","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta3.tgz","fileCount":214,"integrity":"sha512-SfX3fPgf2h73TJ6wCz6riU6irtRz8u2U+CCOobWHpCDP+W160qPHISN+tSLRZ3GcjFD9nk8rT6K6zAvrTNd4/g==","signatures":[{"sig":"MEQCICmYDhux6PvShJwOsQy4aVHfNEdQuk10bFX0lJw9C2zeAiBAmag1/OCWepoEQ1JuinAqDVhGI27ymf/UxNSc3ohBjw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1032272},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta3_1698291270813_0.25301185194270626","host":"s3://npm-registry-packages"}},"0.3.7-beta4":{"name":"@neoswap/solana","version":"0.3.7-beta4","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta4","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"254fe2ca6df188bc382f8b2ddd07343fe85c1193","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta4.tgz","fileCount":214,"integrity":"sha512-FiDRLO3aJoOq1TBCNTAqfhMWtkgQIkRY0rOoEfwQ0Ln+zfqOm+xedouLS+sjLVd6NWMdSLuYVQ/SavtCvm0nGg==","signatures":[{"sig":"MEUCIQCLCjKGEpqVDBfHXIGR2vxWdGzKswRqYLZmPCM7jRmXJwIgGCUCtyp4tLkrx5h29yPlBFwjUnjTWbA0tA9RooJLvz8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1032276},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta4_1698292036711_0.5287473001871041","host":"s3://npm-registry-packages"}},"0.3.7-beta5":{"name":"@neoswap/solana","version":"0.3.7-beta5","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta5","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"db6b16f8c1a8f4abe3ff3bec9d6b6230f44d9ba2","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta5.tgz","fileCount":214,"integrity":"sha512-G8q5Izl7YQEz+h9UuH4HVdlA6F00Ol76DKJHjv/mRNbEcidLrHP8thIRdHxuhejmku5OtPR57Bw2c3oq0dt7nw==","signatures":[{"sig":"MEQCIADmjDuEx7uf5qMPMOdegzksNZ+/nVNKwXwC+OWiIwVGAiB1bsEcuj6caMg2v6a71xIFKtg+aix6oxPQuOniXr6EgA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1033499},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta5_1698292599287_0.8481215670499724","host":"s3://npm-registry-packages"}},"0.3.7-beta6":{"name":"@neoswap/solana","version":"0.3.7-beta6","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta6","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b6f706548949707bc206bae7b03e984fd3149159","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta6.tgz","fileCount":214,"integrity":"sha512-yaceLJ2nGr7dNQlSzBQQB3RJH+Qa49PZTpe28ORzQnVLIxzbdt2p54YvKdm/Pcx+CiPHuyhsj7lVbese1ILYRw==","signatures":[{"sig":"MEQCIBHyjluHR1DZNdvvKVwnXyd1XSYEmyps20BlwR+9sayzAiAx7bKXKSGwJh0RtKqAlg5zll1sBqZWSc+fcfZ8KO3mjg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1035423},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta6_1698293206825_0.6281928261814416","host":"s3://npm-registry-packages"}},"0.3.7-beta7":{"name":"@neoswap/solana","version":"0.3.7-beta7","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta7","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"7b78577a216e219cbba179970b4684c86f281da5","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta7.tgz","fileCount":214,"integrity":"sha512-1lhvHXojylEf6+OQB79AoR2C2CyfjbiAYPwdrgag8LSbV5O5lpOI+nMfRjL4H4SnQPOnjQHI8cwzW58m+4VLTA==","signatures":[{"sig":"MEQCICXKfXfjfpPcmxK5DgWL/yhJ7hPynGqDcp6Ium5OQCsdAiAWGZQ1BoMQM2yzk15ygXj1DX/g1vD1hff64oI00Vc6tA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1034611},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta7_1698293614234_0.17019153699277112","host":"s3://npm-registry-packages"}},"0.3.7-beta8":{"name":"@neoswap/solana","version":"0.3.7-beta8","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta8","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"00910d2b072e025b8157891b4e402674bf8df92b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta8.tgz","fileCount":222,"integrity":"sha512-ZyVbMtd+AeVrPozPk//4wmVl7tmwO0k5bXsRLiZx3rorl9A3ZWIDNsUf88ekUzdCYyOJYHHs8T8n7zCugGxyXA==","signatures":[{"sig":"MEYCIQCqtpVLYvJfr359Sec5omsxIAgJzMArayEeMnoFVg0cVwIhAMDdHUyH76XdbQSzUpFUNG3XGTWyD3dsILqmis3p6ztn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1067405},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta8_1698410810648_0.7891441314378467","host":"s3://npm-registry-packages"}},"0.3.7-beta9":{"name":"@neoswap/solana","version":"0.3.7-beta9","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta9","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b39fb16ceb6679743df646d4af2b50545ccd79e0","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta9.tgz","fileCount":222,"integrity":"sha512-JaoiqorT1kbWPW2ioanbMKyybDmC2k1yBd/ZeP5SvDIH7i0JNO2bm32itaikw9eeDVEf2TeO4ff8uc51ZUBfrA==","signatures":[{"sig":"MEQCIAYhZ89sky+50a4CH2rPGSGl6x7yPUDigiFVrCqyJOgMAiATHieiQmci+odxtwY0adoaz3aS9HqKQJmCtOFNlnLywQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1067477},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta9_1698411252792_0.4868465040827601","host":"s3://npm-registry-packages"}},"0.3.7-beta10":{"name":"@neoswap/solana","version":"0.3.7-beta10","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta10","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"96915cb01a6275db57902172128a2cb4b4d9629b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta10.tgz","fileCount":222,"integrity":"sha512-63t25F1UgdDzyTxziWxPxwDwRLr/3GhYcFRxis6Xe8ExooJmdJdVEiQqiYExhHeR1/YzKe9cHpMtgdDQMMQU3w==","signatures":[{"sig":"MEQCIGKKPKckRi/A82S0Rf80+sKVz1DyEcKbIj310c4cY2EeAiAqj4aLK7XEIom4gQmemZHyqfC9DsqxQXbxVgtBNFQk7A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1067484},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta10_1698411455476_0.27660757391190893","host":"s3://npm-registry-packages"}},"0.3.7-beta11":{"name":"@neoswap/solana","version":"0.3.7-beta11","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7-beta11","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"8f73d4a366c1b553ab964990f3665c6544cff825","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7-beta11.tgz","fileCount":182,"integrity":"sha512-VwzaN/52OmV33qP3QfWgvqY0sqKKFEUedo4LbVciceifNGHW/7/JG/IkgpIyqiCTYJIXsfzQCNhMooEXUtNMYg==","signatures":[{"sig":"MEUCIAMWP5DVc7gWL4Fb0p+pApO6QGg/kEOip7IAmo+1vj/WAiEAkzcd4rJjMvFHb3WAdEe7Ael04E/mwgMoss71GSZ/8DQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872077},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7-beta11_1699900455218_0.6754529857201859","host":"s3://npm-registry-packages"}},"0.3.7":{"name":"@neoswap/solana","version":"0.3.7","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.7","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"cf8757429ef82075dc72a4a821cdccade2ce21da","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.7.tgz","fileCount":182,"integrity":"sha512-Jp6kX2Ai6UV0kDohoMWMWJQ1y+T9cIOUSAwXy82TfzKiEAzHXRhGmLgZNb5C83p5P+T8Vpss5FWQQiwe+O8ZvQ==","signatures":[{"sig":"MEYCIQD+CtzR21IjjG4fS39WhqKsGO2dqnQrqn7w4URwTSr5YAIhAP7MmsXIOdyB87TQuOBrQKKU09Vh59vOZHllfB8RP3cr","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872070},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.7_1699900485435_0.2243478250322175","host":"s3://npm-registry-packages"}},"0.3.8-beta0":{"name":"@neoswap/solana","version":"0.3.8-beta0","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.8-beta0","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"6d8affec15bc209bb912a434cb33991c9ba438be","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.8-beta0.tgz","fileCount":182,"integrity":"sha512-MXV6K76alkL8KKc5t1WBTjUTxhBek3taLV5zWURsubtyFysOJBl9TIbbsz8OcqCk2Uo2wEIUbj4JozwzqNO/8A==","signatures":[{"sig":"MEYCIQC7ssgOtk6VmRXi/QElYF7yTn8Jy6Ch9jls5vsx7jZ1ogIhANuq5XilZXboG1gtifB3ZmoK5wkK4p/d+iN3eF031Dsu","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872156},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.8-beta0_1699913181580_0.7824624966595553","host":"s3://npm-registry-packages"}},"0.3.8":{"name":"@neoswap/solana","version":"0.3.8","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.8","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"1d846f73ebce7fafe5609c7eaad52e726308560c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.8.tgz","fileCount":182,"integrity":"sha512-8hO67Y85/IPCxTuPdEX7dPTrQspfu84SdbV7sHOpKbFShpFrmNAw1aMBGXRxO8whWPGmjzDjCU8FW6A5Wvdtlw==","signatures":[{"sig":"MEUCIQD5OQ3ywbfC6tJvnSTa1+zF0I/gHUmRjSUYerwnqaVQWwIgZhIvuSQTEUxRD0YBTvhjtM0LyYc4VChS7lUjIl1H16c=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":872150},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"0028b17ae433a1e23632aa36dd932689c00d9e8e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.8_1699913326107_0.42528123205065804","host":"s3://npm-registry-packages"}},"0.3.9-beta1":{"name":"@neoswap/solana","version":"0.3.9-beta1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.9-beta1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"1f1bdc9dff138dc3f40ab36a28e4e67b55dc0b38","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.9-beta1.tgz","fileCount":222,"integrity":"sha512-UuI+9YmMWOcKdBRChh1WgC6YqQp0ONj4vGdwJeerkm3SuMqcSVAiPy84FRZNEK+XT+ul/8sXn9F8tl+riXSqrw==","signatures":[{"sig":"MEYCIQCV6CvqnCJ3tULIPP0JvdguwMXLp2EDh+iIrWMlb29khQIhAL8KefMB+2zBYaOYzVX8egi/TeohlZ07cjyQeclEjb3e","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1080285},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"ced4ca62dc38c270d218393305697c31061316b6","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.9-beta1_1699992979479_0.2253360720411577","host":"s3://npm-registry-packages"}},"0.3.9-beta2":{"name":"@neoswap/solana","version":"0.3.9-beta2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.9-beta2","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"306bfa9a3563ba1c39681592b79d8223747a47d3","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.9-beta2.tgz","fileCount":222,"integrity":"sha512-SJXvtyUkE+oBHCH7jCCK5ZtMVuWrqa1c7BslOZBRJJIwHUymGoAcln9nTksKJ0BWBR3Cqw8XEtiWWSvdxpzrqQ==","signatures":[{"sig":"MEUCIQDvVhZ3lJpAeaUXpA3aqhr37adyIdXrGpzLhV+kRPm/hAIgPakd4if1stG13Pmo6Hz+fn624DvPLqSXMC1b/J9IB78=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1077620},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"ced4ca62dc38c270d218393305697c31061316b6","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.9-beta2_1700002600821_0.4405528848065481","host":"s3://npm-registry-packages"}},"0.3.9-beta3":{"name":"@neoswap/solana","version":"0.3.9-beta3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.9-beta3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"5f125f3e74d41dd5be78d57fa7f4cbc8775c2b34","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.9-beta3.tgz","fileCount":222,"integrity":"sha512-I7cqd/4hkwkDDM6au39aJBav8dzpgJQv0sdDkIB1lRl6lG/hSiSoK9TYUtzOyupaZxMe3YVEIXIVVN5Ft7/pgQ==","signatures":[{"sig":"MEYCIQDgQqY0pFuBVy4gZh1r/8YuHJGz753Xuel6lANmv8mfegIhALq/gQd+pMVn8LP3VP+pWAY6Jk2zBmjDT/h2Utog+gE5","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1080315},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"ced4ca62dc38c270d218393305697c31061316b6","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.9-beta3_1700003734450_0.445694507176156","host":"s3://npm-registry-packages"}},"0.3.9-beta4":{"name":"@neoswap/solana","version":"0.3.9-beta4","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.9-beta4","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"ffde2f7fca06c39f067a2b0fcbeb8133b9ab2daa","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.9-beta4.tgz","fileCount":222,"integrity":"sha512-ny+e6fCFlcfKC3nfJGF95ElI3v0EOEEu3Hl0ByTI+XUx9KaSB6jNrc7pplGYIZCuOg6T/R+7u+HKisqzjibQBQ==","signatures":[{"sig":"MEQCIBS3GDwy9URkRJLE9QPbnuYgLftjYmOBLMXukgY7sfzeAiBox7+0hKb6EdEv+XgRfsG+kQ3diK4IwxnJvIerB2v32g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1081271},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"ced4ca62dc38c270d218393305697c31061316b6","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.9-beta4_1700004679659_0.04850908112785568","host":"s3://npm-registry-packages"}},"0.3.9-beta5":{"name":"@neoswap/solana","version":"0.3.9-beta5","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.9-beta5","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"1e507913b771ef675e376faf8b53c7bf85a24778","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.9-beta5.tgz","fileCount":222,"integrity":"sha512-f1pzsJjCmmxdC9i9eaDWFaNQFfd2gFLgtoEqHKyeRzSkxPUTDHD6jOeHDHT/QmYJoOic3TjNdrdUi06qoX4Sew==","signatures":[{"sig":"MEUCIQCXBhrnR6KVwyiVIE68R0Cnrv2sJDZmlEXgpiKBO10zpQIgUTt4HCXBvOENls2mEpa22NnZY5oFUgFGmRLu3F8kQSg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1081695},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"ced4ca62dc38c270d218393305697c31061316b6","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.9-beta5_1700005293684_0.794680854202539","host":"s3://npm-registry-packages"}},"0.3.9-beta6":{"name":"@neoswap/solana","version":"0.3.9-beta6","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.9-beta6","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"dba73f1284381d16c928b08f033b0ec54bdf045b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.9-beta6.tgz","fileCount":222,"integrity":"sha512-NnqWzwAXwuT2E5jxdHnepy8WnkeKUn/ajKvgm/kqCskfBJj/H8WitetO4vzHLOqoTGzzKMN0Luc6kseiu6XG9A==","signatures":[{"sig":"MEUCIQDnPiDZ5JCehEdXukm0uGAvi504EkDT5CthIc6wqbtaAgIgGS4KODoM8YSHOUGogq7X8BNFn49VrfgglqDHyL5Yoy4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1082943},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"ced4ca62dc38c270d218393305697c31061316b6","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.9-beta6_1700005818269_0.21641233761916134","host":"s3://npm-registry-packages"}},"0.3.9-beta7":{"name":"@neoswap/solana","version":"0.3.9-beta7","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.9-beta7","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"c78e26893021ef219651646291396e993c59b9f7","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.9-beta7.tgz","fileCount":222,"integrity":"sha512-2CSUX57aFitjmXmll7zGDENNhGekgDHOGfmv7pF+0SiYlvdUVnD1DzhzQ8toXP8KJRohfkLrbIyWWteWyLCgVg==","signatures":[{"sig":"MEUCIQDer/kgrAvRSZQYnlfVAThSu7bJ2q3v09zHruZFgjXe2wIgLp6fxsgAGkeqaF2CFKzrYcIn0T9Vtg/hwBTOZSGal38=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1082943},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"ced4ca62dc38c270d218393305697c31061316b6","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.9-beta7_1700006056692_0.9714718452909663","host":"s3://npm-registry-packages"}},"0.3.9-beta8":{"name":"@neoswap/solana","version":"0.3.9-beta8","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.9-beta8","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"bd98493df8dc4bbae569aa0cceb9c261901dfb16","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.9-beta8.tgz","fileCount":222,"integrity":"sha512-vGuVzy1SGkaSxoeIz+WoxHUouEO+8xXnzqIE4evWm/7CtmqRCfpQGlJUlvxwddYPQOYgYwxjgH07wr9tuPp8Ww==","signatures":[{"sig":"MEUCIQDHUZNP9GRjAGgNaUH1e+twPqYklqsRTYZw3lSnoco4kQIgQMNh56b2p7DUQ3vG8c/8khcshrv3P90OfEUcRJt1yYk=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1083705},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","gitHead":"ced4ca62dc38c270d218393305697c31061316b6","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.9-beta8_1700006152284_0.2243951784104059","host":"s3://npm-registry-packages"}},"0.3.9":{"name":"@neoswap/solana","version":"0.3.9","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.9","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"619861639d3f0677a4746f2c72ded3d5968bdc66","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.9.tgz","fileCount":182,"integrity":"sha512-ofSoSo4Vrk0GZXItrTLCEIem6fBR+CddSwE9E1wvicfVGaKMqL3ACir54Ow8+Z4Kn0MZCqS3tJHNxEC/xDFG3w==","signatures":[{"sig":"MEUCIGK57EqMtKKnFpwByay/YGUuKG7rTMQrTZM2vwMteqwSAiEAqhWUjrt+89osh+laVk5LfdVsgVO3rwDBQaNyNCj49hE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":873329},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"30543e3913967dc99f46a61c83394dd0911b4367","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.9_1703247796414_0.1784626402849674","host":"s3://npm-registry-packages"}},"0.3.10":{"name":"@neoswap/solana","version":"0.3.10","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.10","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"049febb328d6dda086435599fb2d793a3d8ccddd","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.10.tgz","fileCount":182,"integrity":"sha512-CGa0Y5nFfqWBhD0Pm666RxENaXcfHLuABnLCBfMJTH2h30xPPFoAY1+FWxj3SluEUlBGAhJR31dUGT5qJRU1Iw==","signatures":[{"sig":"MEUCIFL9yypMFSL3CsUEPlTWxg13xaYnxknPRxGsX97oXW5ZAiEAh71HGrQJfpuEdrfSnyw3OhYicYlUyxaCrDAi5XpaH/o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":873330},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"151de767df92f35587881f6ade28b2c51aefbbe5","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.10_1703257259744_0.13408335352433065","host":"s3://npm-registry-packages"}},"0.3.11":{"name":"@neoswap/solana","version":"0.3.11","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.11","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d66aa8de451887727b10fd3bc69b5defe5a50751","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.11.tgz","fileCount":210,"integrity":"sha512-A5wr42Mr/O+kZRreFioCyRfjczNNLIQZP5J9sU9XAjgZWGAmPiwRhdGTN8mjWIRZ0DMv3HpDFtFobdkMg5J7DA==","signatures":[{"sig":"MEUCIEPsZlD4R/9zeDf1APFuWQ3pwhIvM+lrTB4n89RXdx/jAiEAvVSR4q/+f6xqK24Nr0x2uO461YM1KDhrwb5vA9jUDLs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1010146},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"11cdad9d5b1dc283ca1749a80f5fe7b74587eae2","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.5.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"1.87.6","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@solana/spl-account-compression":"0.2.0","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.11_1704803812949_0.6240530375026252","host":"s3://npm-registry-packages"}},"0.3.12":{"name":"@neoswap/solana","version":"0.3.12","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.12","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b2fa48a5e51f30ab01f0289e4ec2024a270f6fce","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.12.tgz","fileCount":186,"integrity":"sha512-Vk1JKeyDcBAhEop/CwO4b9Tl8PFM+RNTHlkmTFxH2/Qjcw98VjPBsIRAA0YKVeROVmrON5WBsm9t5C+ZUs5MuA==","signatures":[{"sig":"MEQCIBnwR0aRtZlFj4hmToa0rVZqx/2pThQWSTu4pnPpyNHvAiB4EPrhB1EWhZGdMlMAINIwW3bRHZDMRXkhoYvuEmb38A==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":897904},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"67668b4b8d65252bdbef83cd755700bf79987f52","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.12_1710682056468_0.7466239697940988","host":"s3://npm-registry-packages"}},"0.3.13":{"name":"@neoswap/solana","version":"0.3.13","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.13","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b117a426301d8e1d8a363fb04aec340f9c7830a6","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.13.tgz","fileCount":186,"integrity":"sha512-2L5rcAIIWkMj4Izvz2z01fmqK+Yl9dYFMhy4+Q/xGiCTw1KbYXpkKnJrcSeX/TQb4j1LooaxF7eoYqrS1RCJWQ==","signatures":[{"sig":"MEQCIGMLeTY+G2v19BTlGPjyJJiIb5PMt+enw7RpjjHWEW8qAiBzqbyymbwy2OY6XfpwX5a/b0O3ND4vwdhKSqSvBmOQ9Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":897904},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"f7b65045e82decf73b932dd4470d9101d54334a3","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.13_1710685074706_0.7376777002246853","host":"s3://npm-registry-packages"}},"0.3.14":{"name":"@neoswap/solana","version":"0.3.14","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.14","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"7f77d0e9f6a1c0538faae7c1e5945795b9a307ee","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.14.tgz","fileCount":186,"integrity":"sha512-XlXXNFEfg8tXZRo353dGNfFpdGiWiGizeUCDa1a/4gi+YyNry+aYTO4WFW64OfkKEc+aqkPD8R6/rvsPuWOamA==","signatures":[{"sig":"MEUCIQCM0eoJQrKh5ZLqbT2DBxRN4grnLtf5CFQWfj9BIgDE1AIgU5++SzG/LGjFojdsvcZemo0AxRhd4iw89VD8nrliQdE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":897904},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"b58c8ee5fee889bb6fe13d671c1aa46b78336d25","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.14_1710686066485_0.6201383863681225","host":"s3://npm-registry-packages"}},"0.3.15":{"name":"@neoswap/solana","version":"0.3.15","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.15","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d3c5024a643ea0813feb57fd0913862cc1c2d47d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.15.tgz","fileCount":186,"integrity":"sha512-oeoSyYy/ccPPvvXmnQKP4oSdxcerFgNlynHPFM5lPIPVgWQl6XMDnvBbkQwvdfMwM4Ny/Un4GkrtBc0pU7D6Bg==","signatures":[{"sig":"MEYCIQCifas6beNq/w26kr4tilS4wrwIeMkkGxc477zmfl2R7wIhAM6V0XnKMKK31yOErPT5hGsu23jZvO9ndshG0HOPUxoT","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":900842},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"2bb9f97f8fbe0deb95531b2713c71256399efbef","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.15_1710686500094_0.6720949429095098","host":"s3://npm-registry-packages"}},"0.3.16":{"name":"@neoswap/solana","version":"0.3.16","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.16","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"e5ff64d5d39d2bf5a02b07d8afe4a522e54d8fcd","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.16.tgz","fileCount":186,"integrity":"sha512-5Bao8l/i7dhC8KwCWy0yEc+gV7lH8kCjCLh9Q2GmufmyIPFbZEg0TUjagGVPspBjP4aHpXqeUnYWEJgbnJ4cIw==","signatures":[{"sig":"MEYCIQCcM6n+pz314GHegoAmf2MJRzxzhuXama+u3REsT67O2AIhAIBYn+DzW2CGYBiyTvngL8nlEqJlbxo2Vc7Fv7Cn+6/c","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":900846},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"da4ba36156ff6a1dc0d854a317746d453559a4b1","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.16_1710699655581_0.46591670359972137","host":"s3://npm-registry-packages"}},"0.3.17-beta":{"name":"@neoswap/solana","version":"0.3.17-beta","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.17-beta","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"e2c3d602cad1f43efc3da901f79c8caa38b052ba","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.17-beta.tgz","fileCount":186,"integrity":"sha512-tSd8z4Pe0Mit6xSJoNrgG2936aTlzwmZIkUsna3iKeADwEOpmlzsRv/ERV7OPcKeY2rCo8P+bil1/MGTv78PfQ==","signatures":[{"sig":"MEYCIQCeUb3Uk1M6kKJTOQZ/oRnti3OrBvOc6FE7nMShOzQu4AIhAK1rb8s9IlxNPtYRONjre3MQ76Zc7drxktUhFu3YE4xf","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":912998},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\r\n<br />\r\n<div align=\"center\">\r\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\r\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\r\n  </a>\r\n\r\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\r\n\r\n</div>\r\n\r\n<!-- TABLE OF CONTENTS -->\r\n<details>\r\n  <summary>Table of Contents</summary>\r\n  <ol>\r\n    <li>\r\n      <a href=\"#about-the-project\">About The Project</a>\r\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\r\n\r\n    </li>\r\n    <li>\r\n      <a href=\"#Install-NPM-package\">Installation</a>\r\n\r\n    </li>\r\n    <li><a href=\"#usage\">Usage</a></li>\r\n\r\n  </ol>\r\n</details>\r\n\r\n<!-- ABOUT THE PROJECT -->\r\n\r\n## About The Project\r\n\r\n[Neoswap Website](https://neoswap.xyz/)\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Install NPM package\r\n\r\n```sh\r\nnpm install @neoswap/solana\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n<!-- USAGE EXAMPLES -->\r\n\r\n# Usage\r\n\r\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\r\n\r\n## Create Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\r\n} = await neoSwap.initializeSwap({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.swapInfo, // Data of the swap\r\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\r\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n});\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeSwapData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\r\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\r\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\r\n\r\n});\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\r\n    const transaction = initializeSwapData.transactions[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Deposit Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.depositSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet that will deposit in the swap\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        user: PublicKey, // User that will deposit assets in the swap\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\r\n    const transaction = depositTransactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Claim Swap\r\n\r\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\r\n\r\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.claimAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Cancel Swap (requires to be admin to finish closing accounts)\r\n\r\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\r\n\r\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\r\n\r\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\r\n\r\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.cancelAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\nimport { Transaction, Keypair } from \"@solana/web3.js\";\r\n\r\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\r\n\r\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\r\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\r\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\r\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\r\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\r\n\r\n});\r\n```\r\n\r\n## Types section\r\n\r\n### Types converter\r\n\r\n```ts\r\n\r\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \r\n\r\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\r\n\r\n```\r\n\r\n### Types\r\n\r\nswapInfo represents the Data of a swap in a human readable way\r\n\r\n```ts\r\ntype SwapInfo = {\r\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\r\n    preSeed?: string;\r\n    currency: string;\r\n    users: { address: string; items: SwapUserInfo }[];\r\n};\r\n```\r\n\r\nSwapUserInfo represents the data a user in a swap in a human readable way\r\n\r\n```ts\r\ntype SwapUserInfo = {\r\n    give: GiveSwapItem[];\r\n    get: GetSwapItem[];\r\n    token: { amount: number; status?: string };\r\n    status?:\r\n        | \"pending\"\r\n        | \"partiallyDeposited\"\r\n        | \"deposited\"\r\n        | \"partiallyClaimed\"\r\n        | \"claimed\"\r\n        | \"partiallyCanceled\"\r\n        | \"canceled\";\r\n};\r\n```\r\n\r\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\r\n\r\n```ts\r\ntype GiveSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    getters: {\r\n        address: string;\r\n        amount: number;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n\r\ntype GetSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    givers: {\r\n        amount: number;\r\n        address: string;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n```\r\n\r\nSwapIdentity represents the Identity of the swap\r\n\r\n```ts\r\ntype SwapIdentity = {\r\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\r\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\r\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\r\n    swapDataAccount_bump: number; // Bump of the PDA\r\n    swapData: SwapData; // Data of the swapDataAccount\r\n};\r\n```\r\n\r\nSwapData represents the data of the swap inside the PDA\r\n\r\n```ts\r\ntype SwapData = {\r\n    initializer: PublicKey;\r\n    status: number;\r\n    nbItems: number;\r\n    preSeed: string;\r\n    items: Array<NftSwapItem>;\r\n    acceptedPayement: PublicKey;\r\n};\r\n```\r\n\r\nNftSwapItem represents the data of one Item in SwapData\r\n\r\n```ts\r\ntype NftSwapItem = {\r\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\r\n    isNft: boolean; // true if the item is a NFT\r\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\r\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\r\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\r\n    amount: BN; // Amount of the item to be sent\r\n    owner: PublicKey; // Owner of the item\r\n    destinary: PublicKey; // Destinary of the item\r\n    status: number; // Status of the item\r\n};\r\n```\r\n\r\nInitializeData represents the data after initializing the swap\r\n\r\n```ts\r\ntype InitializeData = {\r\n    programId: string; // ProgramId of the solana program the swap is being deployed to\r\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\r\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\r\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\r\n};\r\n```\r\n\r\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\r\n\r\n```ts\r\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\r\n```\r\n\r\n## Error Type\r\n\r\nErrorFeedback represents the feedback thrown when an error is found\r\n\r\n```ts\r\ntype ErrorFeedback = {\r\n    blockchain: \"solana\";\r\n    status: \"error\";\r\n    message: string | unknown;\r\n    swapStatus?: number;\r\n};\r\n```\r\n\r\n## Statuses\r\n\r\n### Program Swap status\r\n\r\n```\r\nTradeStatus:\r\n    0 => Initializing\r\n    1 => WaitingToDeposit\r\n    2 => WaitingToClaim\r\n    3 => Closed\r\n\r\n    100 => Canceling\r\n    101 => Canceled\r\n```\r\n\r\n### Program Items status\r\n\r\n```\r\nItemStatus :\r\n    10 => NFTPending\r\n    11 => SolPending\r\n\r\n    20 => NFTDeposited\r\n    21 => SolDeposited\r\n    22 => SolToClaim\r\n\r\n    30 => NFTClaimed\r\n    31 => SolClaimed\r\n\r\n    100 => NFTcanceled\r\n    101 => Solcanceled\r\n\r\n    110 => NFTcanceledRecovered\r\n    111 => SolcanceledRecovered\r\n```\r\n\r\n### UserDataInSwap from UTILS.userSwapDetails\r\n\r\n```ts\r\ntype UserDataInSwap = {\r\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\r\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\r\n\r\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\r\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\r\n\r\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\r\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\r\n\r\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\r\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\r\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\r\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\r\n};\r\n```\r\n\r\n### Dummy data\r\n\r\n```ts\r\nlet swapInfo: neoTypes.SwapInfo = {\r\n    currency: \"usdcPublickey\",\r\n    preSeed: \"0035\",\r\n    users: [\r\n        {\r\n            address: \"user1Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: 50000 },\r\n            },\r\n        },\r\n        {\r\n            address: \"user2Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: -50000 },\r\n            },\r\n        },\r\n    ],\r\n};\r\n```\r\n\r\n<!-- MARKDOWN LINKS & IMAGES -->\r\n\r\n[neoswap-app]: https://www.neoswap.xyz\r\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\r\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\r\n","gitHead":"b17e6852cee7b80cf2acce9ec592d0903f7c7707","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.17-beta_1710720673613_0.49533201392218285","host":"s3://npm-registry-packages"}},"0.3.17-beta1":{"name":"@neoswap/solana","version":"0.3.17-beta1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.17-beta1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"d581a29766ef3f107dae400865c1a22fd2a6aa31","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.17-beta1.tgz","fileCount":186,"integrity":"sha512-kkq845o/SVU5SNPmsJwe1p1UjybxXHNRRSkRfj8Vxxi3QbuCnbl1gkBTUCZv3SXhOZoI8k2jh9ndPnVPd1E03A==","signatures":[{"sig":"MEYCIQCUvnpnk+8Cr/EIfrANKi+8NrRfL+1/MqETfO6Xxw+TvwIhAKKuRF96NjgVGwCaiLOahCqi5f5Gsm1Kyr0Bohuw+FFW","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":913063},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\r\n<br />\r\n<div align=\"center\">\r\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\r\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\r\n  </a>\r\n\r\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\r\n\r\n</div>\r\n\r\n<!-- TABLE OF CONTENTS -->\r\n<details>\r\n  <summary>Table of Contents</summary>\r\n  <ol>\r\n    <li>\r\n      <a href=\"#about-the-project\">About The Project</a>\r\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\r\n\r\n    </li>\r\n    <li>\r\n      <a href=\"#Install-NPM-package\">Installation</a>\r\n\r\n    </li>\r\n    <li><a href=\"#usage\">Usage</a></li>\r\n\r\n  </ol>\r\n</details>\r\n\r\n<!-- ABOUT THE PROJECT -->\r\n\r\n## About The Project\r\n\r\n[Neoswap Website](https://neoswap.xyz/)\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Install NPM package\r\n\r\n```sh\r\nnpm install @neoswap/solana\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n<!-- USAGE EXAMPLES -->\r\n\r\n# Usage\r\n\r\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\r\n\r\n## Create Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\r\n} = await neoSwap.initializeSwap({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.swapInfo, // Data of the swap\r\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\r\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n});\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeSwapData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\r\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\r\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\r\n\r\n});\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\r\n    const transaction = initializeSwapData.transactions[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Deposit Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.depositSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet that will deposit in the swap\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        user: PublicKey, // User that will deposit assets in the swap\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\r\n    const transaction = depositTransactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Claim Swap\r\n\r\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\r\n\r\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.claimAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Cancel Swap (requires to be admin to finish closing accounts)\r\n\r\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\r\n\r\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\r\n\r\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\r\n\r\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.cancelAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\nimport { Transaction, Keypair } from \"@solana/web3.js\";\r\n\r\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\r\n\r\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\r\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\r\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\r\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\r\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\r\n\r\n});\r\n```\r\n\r\n## Types section\r\n\r\n### Types converter\r\n\r\n```ts\r\n\r\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \r\n\r\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\r\n\r\n```\r\n\r\n### Types\r\n\r\nswapInfo represents the Data of a swap in a human readable way\r\n\r\n```ts\r\ntype SwapInfo = {\r\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\r\n    preSeed?: string;\r\n    currency: string;\r\n    users: { address: string; items: SwapUserInfo }[];\r\n};\r\n```\r\n\r\nSwapUserInfo represents the data a user in a swap in a human readable way\r\n\r\n```ts\r\ntype SwapUserInfo = {\r\n    give: GiveSwapItem[];\r\n    get: GetSwapItem[];\r\n    token: { amount: number; status?: string };\r\n    status?:\r\n        | \"pending\"\r\n        | \"partiallyDeposited\"\r\n        | \"deposited\"\r\n        | \"partiallyClaimed\"\r\n        | \"claimed\"\r\n        | \"partiallyCanceled\"\r\n        | \"canceled\";\r\n};\r\n```\r\n\r\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\r\n\r\n```ts\r\ntype GiveSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    getters: {\r\n        address: string;\r\n        amount: number;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n\r\ntype GetSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    givers: {\r\n        amount: number;\r\n        address: string;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n```\r\n\r\nSwapIdentity represents the Identity of the swap\r\n\r\n```ts\r\ntype SwapIdentity = {\r\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\r\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\r\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\r\n    swapDataAccount_bump: number; // Bump of the PDA\r\n    swapData: SwapData; // Data of the swapDataAccount\r\n};\r\n```\r\n\r\nSwapData represents the data of the swap inside the PDA\r\n\r\n```ts\r\ntype SwapData = {\r\n    initializer: PublicKey;\r\n    status: number;\r\n    nbItems: number;\r\n    preSeed: string;\r\n    items: Array<NftSwapItem>;\r\n    acceptedPayement: PublicKey;\r\n};\r\n```\r\n\r\nNftSwapItem represents the data of one Item in SwapData\r\n\r\n```ts\r\ntype NftSwapItem = {\r\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\r\n    isNft: boolean; // true if the item is a NFT\r\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\r\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\r\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\r\n    amount: BN; // Amount of the item to be sent\r\n    owner: PublicKey; // Owner of the item\r\n    destinary: PublicKey; // Destinary of the item\r\n    status: number; // Status of the item\r\n};\r\n```\r\n\r\nInitializeData represents the data after initializing the swap\r\n\r\n```ts\r\ntype InitializeData = {\r\n    programId: string; // ProgramId of the solana program the swap is being deployed to\r\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\r\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\r\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\r\n};\r\n```\r\n\r\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\r\n\r\n```ts\r\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\r\n```\r\n\r\n## Error Type\r\n\r\nErrorFeedback represents the feedback thrown when an error is found\r\n\r\n```ts\r\ntype ErrorFeedback = {\r\n    blockchain: \"solana\";\r\n    status: \"error\";\r\n    message: string | unknown;\r\n    swapStatus?: number;\r\n};\r\n```\r\n\r\n## Statuses\r\n\r\n### Program Swap status\r\n\r\n```\r\nTradeStatus:\r\n    0 => Initializing\r\n    1 => WaitingToDeposit\r\n    2 => WaitingToClaim\r\n    3 => Closed\r\n\r\n    100 => Canceling\r\n    101 => Canceled\r\n```\r\n\r\n### Program Items status\r\n\r\n```\r\nItemStatus :\r\n    10 => NFTPending\r\n    11 => SolPending\r\n\r\n    20 => NFTDeposited\r\n    21 => SolDeposited\r\n    22 => SolToClaim\r\n\r\n    30 => NFTClaimed\r\n    31 => SolClaimed\r\n\r\n    100 => NFTcanceled\r\n    101 => Solcanceled\r\n\r\n    110 => NFTcanceledRecovered\r\n    111 => SolcanceledRecovered\r\n```\r\n\r\n### UserDataInSwap from UTILS.userSwapDetails\r\n\r\n```ts\r\ntype UserDataInSwap = {\r\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\r\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\r\n\r\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\r\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\r\n\r\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\r\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\r\n\r\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\r\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\r\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\r\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\r\n};\r\n```\r\n\r\n### Dummy data\r\n\r\n```ts\r\nlet swapInfo: neoTypes.SwapInfo = {\r\n    currency: \"usdcPublickey\",\r\n    preSeed: \"0035\",\r\n    users: [\r\n        {\r\n            address: \"user1Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: 50000 },\r\n            },\r\n        },\r\n        {\r\n            address: \"user2Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: -50000 },\r\n            },\r\n        },\r\n    ],\r\n};\r\n```\r\n\r\n<!-- MARKDOWN LINKS & IMAGES -->\r\n\r\n[neoswap-app]: https://www.neoswap.xyz\r\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\r\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\r\n","gitHead":"dc6c06fa40e7fbfca0ea8f6466f0f92a99297b2d","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.17-beta1_1710720885902_0.79546354034896","host":"s3://npm-registry-packages"}},"0.3.18-beta":{"name":"@neoswap/solana","version":"0.3.18-beta","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.18-beta","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"a6a2842a84b0910b6782172626f555fd7a59cdd4","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.18-beta.tgz","fileCount":186,"integrity":"sha512-DD/0ANF38KlGR4KWe/6LJgQUsmY44Ecep0JzJRtJ6ZEO+Sf3ReD68rO+W9H1j1hsevYLPRQrl0WP83tUXTE4CA==","signatures":[{"sig":"MEQCIB67WYLoTt7Lf1UB8MmVTrFO1jzqsUy/ZEhOk1VyWVJAAiBtTgg809z+ZnHCVhnCUpSIPAALZaXvjAliInKI4NdnFQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":913062},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\r\n<br />\r\n<div align=\"center\">\r\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\r\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\r\n  </a>\r\n\r\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\r\n\r\n</div>\r\n\r\n<!-- TABLE OF CONTENTS -->\r\n<details>\r\n  <summary>Table of Contents</summary>\r\n  <ol>\r\n    <li>\r\n      <a href=\"#about-the-project\">About The Project</a>\r\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\r\n\r\n    </li>\r\n    <li>\r\n      <a href=\"#Install-NPM-package\">Installation</a>\r\n\r\n    </li>\r\n    <li><a href=\"#usage\">Usage</a></li>\r\n\r\n  </ol>\r\n</details>\r\n\r\n<!-- ABOUT THE PROJECT -->\r\n\r\n## About The Project\r\n\r\n[Neoswap Website](https://neoswap.xyz/)\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Install NPM package\r\n\r\n```sh\r\nnpm install @neoswap/solana\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n<!-- USAGE EXAMPLES -->\r\n\r\n# Usage\r\n\r\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\r\n\r\n## Create Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\r\n} = await neoSwap.initializeSwap({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.swapInfo, // Data of the swap\r\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\r\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n});\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeSwapData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\r\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\r\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\r\n\r\n});\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\r\n    const transaction = initializeSwapData.transactions[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Deposit Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.depositSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet that will deposit in the swap\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        user: PublicKey, // User that will deposit assets in the swap\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\r\n    const transaction = depositTransactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Claim Swap\r\n\r\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\r\n\r\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.claimAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Cancel Swap (requires to be admin to finish closing accounts)\r\n\r\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\r\n\r\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\r\n\r\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\r\n\r\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.cancelAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\nimport { Transaction, Keypair } from \"@solana/web3.js\";\r\n\r\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\r\n\r\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\r\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\r\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\r\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\r\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\r\n\r\n});\r\n```\r\n\r\n## Types section\r\n\r\n### Types converter\r\n\r\n```ts\r\n\r\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \r\n\r\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\r\n\r\n```\r\n\r\n### Types\r\n\r\nswapInfo represents the Data of a swap in a human readable way\r\n\r\n```ts\r\ntype SwapInfo = {\r\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\r\n    preSeed?: string;\r\n    currency: string;\r\n    users: { address: string; items: SwapUserInfo }[];\r\n};\r\n```\r\n\r\nSwapUserInfo represents the data a user in a swap in a human readable way\r\n\r\n```ts\r\ntype SwapUserInfo = {\r\n    give: GiveSwapItem[];\r\n    get: GetSwapItem[];\r\n    token: { amount: number; status?: string };\r\n    status?:\r\n        | \"pending\"\r\n        | \"partiallyDeposited\"\r\n        | \"deposited\"\r\n        | \"partiallyClaimed\"\r\n        | \"claimed\"\r\n        | \"partiallyCanceled\"\r\n        | \"canceled\";\r\n};\r\n```\r\n\r\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\r\n\r\n```ts\r\ntype GiveSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    getters: {\r\n        address: string;\r\n        amount: number;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n\r\ntype GetSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    givers: {\r\n        amount: number;\r\n        address: string;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n```\r\n\r\nSwapIdentity represents the Identity of the swap\r\n\r\n```ts\r\ntype SwapIdentity = {\r\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\r\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\r\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\r\n    swapDataAccount_bump: number; // Bump of the PDA\r\n    swapData: SwapData; // Data of the swapDataAccount\r\n};\r\n```\r\n\r\nSwapData represents the data of the swap inside the PDA\r\n\r\n```ts\r\ntype SwapData = {\r\n    initializer: PublicKey;\r\n    status: number;\r\n    nbItems: number;\r\n    preSeed: string;\r\n    items: Array<NftSwapItem>;\r\n    acceptedPayement: PublicKey;\r\n};\r\n```\r\n\r\nNftSwapItem represents the data of one Item in SwapData\r\n\r\n```ts\r\ntype NftSwapItem = {\r\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\r\n    isNft: boolean; // true if the item is a NFT\r\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\r\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\r\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\r\n    amount: BN; // Amount of the item to be sent\r\n    owner: PublicKey; // Owner of the item\r\n    destinary: PublicKey; // Destinary of the item\r\n    status: number; // Status of the item\r\n};\r\n```\r\n\r\nInitializeData represents the data after initializing the swap\r\n\r\n```ts\r\ntype InitializeData = {\r\n    programId: string; // ProgramId of the solana program the swap is being deployed to\r\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\r\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\r\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\r\n};\r\n```\r\n\r\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\r\n\r\n```ts\r\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\r\n```\r\n\r\n## Error Type\r\n\r\nErrorFeedback represents the feedback thrown when an error is found\r\n\r\n```ts\r\ntype ErrorFeedback = {\r\n    blockchain: \"solana\";\r\n    status: \"error\";\r\n    message: string | unknown;\r\n    swapStatus?: number;\r\n};\r\n```\r\n\r\n## Statuses\r\n\r\n### Program Swap status\r\n\r\n```\r\nTradeStatus:\r\n    0 => Initializing\r\n    1 => WaitingToDeposit\r\n    2 => WaitingToClaim\r\n    3 => Closed\r\n\r\n    100 => Canceling\r\n    101 => Canceled\r\n```\r\n\r\n### Program Items status\r\n\r\n```\r\nItemStatus :\r\n    10 => NFTPending\r\n    11 => SolPending\r\n\r\n    20 => NFTDeposited\r\n    21 => SolDeposited\r\n    22 => SolToClaim\r\n\r\n    30 => NFTClaimed\r\n    31 => SolClaimed\r\n\r\n    100 => NFTcanceled\r\n    101 => Solcanceled\r\n\r\n    110 => NFTcanceledRecovered\r\n    111 => SolcanceledRecovered\r\n```\r\n\r\n### UserDataInSwap from UTILS.userSwapDetails\r\n\r\n```ts\r\ntype UserDataInSwap = {\r\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\r\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\r\n\r\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\r\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\r\n\r\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\r\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\r\n\r\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\r\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\r\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\r\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\r\n};\r\n```\r\n\r\n### Dummy data\r\n\r\n```ts\r\nlet swapInfo: neoTypes.SwapInfo = {\r\n    currency: \"usdcPublickey\",\r\n    preSeed: \"0035\",\r\n    users: [\r\n        {\r\n            address: \"user1Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: 50000 },\r\n            },\r\n        },\r\n        {\r\n            address: \"user2Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: -50000 },\r\n            },\r\n        },\r\n    ],\r\n};\r\n```\r\n\r\n<!-- MARKDOWN LINKS & IMAGES -->\r\n\r\n[neoswap-app]: https://www.neoswap.xyz\r\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\r\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\r\n","gitHead":"091536b4b7d848abff61715f8522fbef7b5620d0","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.18-beta_1710721163187_0.3887241761479199","host":"s3://npm-registry-packages"}},"0.3.19-beta":{"name":"@neoswap/solana","version":"0.3.19-beta","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.19-beta","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"f179d74bbc4f020d5c8f5b0a00179b53e522754d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.19-beta.tgz","fileCount":186,"integrity":"sha512-AUngY/jKh3DKAh140j6W3MZVCe2uqzbUHZTqptHIabAHCDljhCwJkn8PNVhWRZW737TDyF4RHRahAqojcS56JA==","signatures":[{"sig":"MEQCIDgA1Gz4DbBOaUHzAP2uLEA7doO8ilFS4ZO6Om5A1gBbAiAH8Nstoh7YyPVxFubFCwyEAvOcwwES+WCUajqKqyaDDg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":914594},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\r\n<br />\r\n<div align=\"center\">\r\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\r\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\r\n  </a>\r\n\r\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\r\n\r\n</div>\r\n\r\n<!-- TABLE OF CONTENTS -->\r\n<details>\r\n  <summary>Table of Contents</summary>\r\n  <ol>\r\n    <li>\r\n      <a href=\"#about-the-project\">About The Project</a>\r\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\r\n\r\n    </li>\r\n    <li>\r\n      <a href=\"#Install-NPM-package\">Installation</a>\r\n\r\n    </li>\r\n    <li><a href=\"#usage\">Usage</a></li>\r\n\r\n  </ol>\r\n</details>\r\n\r\n<!-- ABOUT THE PROJECT -->\r\n\r\n## About The Project\r\n\r\n[Neoswap Website](https://neoswap.xyz/)\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Install NPM package\r\n\r\n```sh\r\nnpm install @neoswap/solana\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n<!-- USAGE EXAMPLES -->\r\n\r\n# Usage\r\n\r\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\r\n\r\n## Create Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\r\n} = await neoSwap.initializeSwap({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.swapInfo, // Data of the swap\r\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\r\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n});\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeSwapData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\r\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\r\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\r\n\r\n});\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\r\n    const transaction = initializeSwapData.transactions[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Deposit Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.depositSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet that will deposit in the swap\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        user: PublicKey, // User that will deposit assets in the swap\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\r\n    const transaction = depositTransactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Claim Swap\r\n\r\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\r\n\r\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.claimAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Cancel Swap (requires to be admin to finish closing accounts)\r\n\r\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\r\n\r\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\r\n\r\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\r\n\r\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.cancelAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\nimport { Transaction, Keypair } from \"@solana/web3.js\";\r\n\r\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\r\n\r\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\r\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\r\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\r\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\r\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\r\n\r\n});\r\n```\r\n\r\n## Types section\r\n\r\n### Types converter\r\n\r\n```ts\r\n\r\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \r\n\r\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\r\n\r\n```\r\n\r\n### Types\r\n\r\nswapInfo represents the Data of a swap in a human readable way\r\n\r\n```ts\r\ntype SwapInfo = {\r\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\r\n    preSeed?: string;\r\n    currency: string;\r\n    users: { address: string; items: SwapUserInfo }[];\r\n};\r\n```\r\n\r\nSwapUserInfo represents the data a user in a swap in a human readable way\r\n\r\n```ts\r\ntype SwapUserInfo = {\r\n    give: GiveSwapItem[];\r\n    get: GetSwapItem[];\r\n    token: { amount: number; status?: string };\r\n    status?:\r\n        | \"pending\"\r\n        | \"partiallyDeposited\"\r\n        | \"deposited\"\r\n        | \"partiallyClaimed\"\r\n        | \"claimed\"\r\n        | \"partiallyCanceled\"\r\n        | \"canceled\";\r\n};\r\n```\r\n\r\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\r\n\r\n```ts\r\ntype GiveSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    getters: {\r\n        address: string;\r\n        amount: number;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n\r\ntype GetSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    givers: {\r\n        amount: number;\r\n        address: string;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n```\r\n\r\nSwapIdentity represents the Identity of the swap\r\n\r\n```ts\r\ntype SwapIdentity = {\r\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\r\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\r\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\r\n    swapDataAccount_bump: number; // Bump of the PDA\r\n    swapData: SwapData; // Data of the swapDataAccount\r\n};\r\n```\r\n\r\nSwapData represents the data of the swap inside the PDA\r\n\r\n```ts\r\ntype SwapData = {\r\n    initializer: PublicKey;\r\n    status: number;\r\n    nbItems: number;\r\n    preSeed: string;\r\n    items: Array<NftSwapItem>;\r\n    acceptedPayement: PublicKey;\r\n};\r\n```\r\n\r\nNftSwapItem represents the data of one Item in SwapData\r\n\r\n```ts\r\ntype NftSwapItem = {\r\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\r\n    isNft: boolean; // true if the item is a NFT\r\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\r\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\r\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\r\n    amount: BN; // Amount of the item to be sent\r\n    owner: PublicKey; // Owner of the item\r\n    destinary: PublicKey; // Destinary of the item\r\n    status: number; // Status of the item\r\n};\r\n```\r\n\r\nInitializeData represents the data after initializing the swap\r\n\r\n```ts\r\ntype InitializeData = {\r\n    programId: string; // ProgramId of the solana program the swap is being deployed to\r\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\r\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\r\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\r\n};\r\n```\r\n\r\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\r\n\r\n```ts\r\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\r\n```\r\n\r\n## Error Type\r\n\r\nErrorFeedback represents the feedback thrown when an error is found\r\n\r\n```ts\r\ntype ErrorFeedback = {\r\n    blockchain: \"solana\";\r\n    status: \"error\";\r\n    message: string | unknown;\r\n    swapStatus?: number;\r\n};\r\n```\r\n\r\n## Statuses\r\n\r\n### Program Swap status\r\n\r\n```\r\nTradeStatus:\r\n    0 => Initializing\r\n    1 => WaitingToDeposit\r\n    2 => WaitingToClaim\r\n    3 => Closed\r\n\r\n    100 => Canceling\r\n    101 => Canceled\r\n```\r\n\r\n### Program Items status\r\n\r\n```\r\nItemStatus :\r\n    10 => NFTPending\r\n    11 => SolPending\r\n\r\n    20 => NFTDeposited\r\n    21 => SolDeposited\r\n    22 => SolToClaim\r\n\r\n    30 => NFTClaimed\r\n    31 => SolClaimed\r\n\r\n    100 => NFTcanceled\r\n    101 => Solcanceled\r\n\r\n    110 => NFTcanceledRecovered\r\n    111 => SolcanceledRecovered\r\n```\r\n\r\n### UserDataInSwap from UTILS.userSwapDetails\r\n\r\n```ts\r\ntype UserDataInSwap = {\r\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\r\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\r\n\r\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\r\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\r\n\r\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\r\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\r\n\r\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\r\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\r\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\r\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\r\n};\r\n```\r\n\r\n### Dummy data\r\n\r\n```ts\r\nlet swapInfo: neoTypes.SwapInfo = {\r\n    currency: \"usdcPublickey\",\r\n    preSeed: \"0035\",\r\n    users: [\r\n        {\r\n            address: \"user1Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: 50000 },\r\n            },\r\n        },\r\n        {\r\n            address: \"user2Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: -50000 },\r\n            },\r\n        },\r\n    ],\r\n};\r\n```\r\n\r\n<!-- MARKDOWN LINKS & IMAGES -->\r\n\r\n[neoswap-app]: https://www.neoswap.xyz\r\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\r\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\r\n","gitHead":"6aeacc96660422f5b57a7c2241b872b18eee031e","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.19-beta_1710721388797_0.5603336846698344","host":"s3://npm-registry-packages"}},"0.3.20-beta":{"name":"@neoswap/solana","version":"0.3.20-beta","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.20-beta","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0a07a89384900da5201fa8bdc77735a01beca53d","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.20-beta.tgz","fileCount":186,"integrity":"sha512-Rl1cYwiX/yz8oc3R03xqAvUAQCJ9sV4CEBbA5a+ofPsri/z7Fi76oDGW/sNO1PVVsYh3iVR/Fc3m/FhlIHSfTQ==","signatures":[{"sig":"MEUCID/bokVdl2KgVqA2wnyHL9LweZs/VN6/JTgBj950i8v3AiEAq5a5mHev4M+wn6t1El0bQtA+kREJcxTyHUtxRs8RucE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":914594},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\r\n<br />\r\n<div align=\"center\">\r\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\r\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\r\n  </a>\r\n\r\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\r\n\r\n</div>\r\n\r\n<!-- TABLE OF CONTENTS -->\r\n<details>\r\n  <summary>Table of Contents</summary>\r\n  <ol>\r\n    <li>\r\n      <a href=\"#about-the-project\">About The Project</a>\r\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\r\n\r\n    </li>\r\n    <li>\r\n      <a href=\"#Install-NPM-package\">Installation</a>\r\n\r\n    </li>\r\n    <li><a href=\"#usage\">Usage</a></li>\r\n\r\n  </ol>\r\n</details>\r\n\r\n<!-- ABOUT THE PROJECT -->\r\n\r\n## About The Project\r\n\r\n[Neoswap Website](https://neoswap.xyz/)\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Install NPM package\r\n\r\n```sh\r\nnpm install @neoswap/solana\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n<!-- USAGE EXAMPLES -->\r\n\r\n# Usage\r\n\r\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\r\n\r\n## Create Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\r\n} = await neoSwap.initializeSwap({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.swapInfo, // Data of the swap\r\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\r\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n});\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeSwapData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\r\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\r\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\r\n\r\n});\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\r\n    const transaction = initializeSwapData.transactions[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Deposit Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.depositSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet that will deposit in the swap\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        user: PublicKey, // User that will deposit assets in the swap\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\r\n    const transaction = depositTransactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Claim Swap\r\n\r\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\r\n\r\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.claimAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Cancel Swap (requires to be admin to finish closing accounts)\r\n\r\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\r\n\r\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\r\n\r\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\r\n\r\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.cancelAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\nimport { Transaction, Keypair } from \"@solana/web3.js\";\r\n\r\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\r\n\r\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\r\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\r\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\r\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\r\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\r\n\r\n});\r\n```\r\n\r\n## Types section\r\n\r\n### Types converter\r\n\r\n```ts\r\n\r\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \r\n\r\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\r\n\r\n```\r\n\r\n### Types\r\n\r\nswapInfo represents the Data of a swap in a human readable way\r\n\r\n```ts\r\ntype SwapInfo = {\r\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\r\n    preSeed?: string;\r\n    currency: string;\r\n    users: { address: string; items: SwapUserInfo }[];\r\n};\r\n```\r\n\r\nSwapUserInfo represents the data a user in a swap in a human readable way\r\n\r\n```ts\r\ntype SwapUserInfo = {\r\n    give: GiveSwapItem[];\r\n    get: GetSwapItem[];\r\n    token: { amount: number; status?: string };\r\n    status?:\r\n        | \"pending\"\r\n        | \"partiallyDeposited\"\r\n        | \"deposited\"\r\n        | \"partiallyClaimed\"\r\n        | \"claimed\"\r\n        | \"partiallyCanceled\"\r\n        | \"canceled\";\r\n};\r\n```\r\n\r\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\r\n\r\n```ts\r\ntype GiveSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    getters: {\r\n        address: string;\r\n        amount: number;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n\r\ntype GetSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    givers: {\r\n        amount: number;\r\n        address: string;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n```\r\n\r\nSwapIdentity represents the Identity of the swap\r\n\r\n```ts\r\ntype SwapIdentity = {\r\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\r\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\r\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\r\n    swapDataAccount_bump: number; // Bump of the PDA\r\n    swapData: SwapData; // Data of the swapDataAccount\r\n};\r\n```\r\n\r\nSwapData represents the data of the swap inside the PDA\r\n\r\n```ts\r\ntype SwapData = {\r\n    initializer: PublicKey;\r\n    status: number;\r\n    nbItems: number;\r\n    preSeed: string;\r\n    items: Array<NftSwapItem>;\r\n    acceptedPayement: PublicKey;\r\n};\r\n```\r\n\r\nNftSwapItem represents the data of one Item in SwapData\r\n\r\n```ts\r\ntype NftSwapItem = {\r\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\r\n    isNft: boolean; // true if the item is a NFT\r\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\r\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\r\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\r\n    amount: BN; // Amount of the item to be sent\r\n    owner: PublicKey; // Owner of the item\r\n    destinary: PublicKey; // Destinary of the item\r\n    status: number; // Status of the item\r\n};\r\n```\r\n\r\nInitializeData represents the data after initializing the swap\r\n\r\n```ts\r\ntype InitializeData = {\r\n    programId: string; // ProgramId of the solana program the swap is being deployed to\r\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\r\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\r\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\r\n};\r\n```\r\n\r\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\r\n\r\n```ts\r\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\r\n```\r\n\r\n## Error Type\r\n\r\nErrorFeedback represents the feedback thrown when an error is found\r\n\r\n```ts\r\ntype ErrorFeedback = {\r\n    blockchain: \"solana\";\r\n    status: \"error\";\r\n    message: string | unknown;\r\n    swapStatus?: number;\r\n};\r\n```\r\n\r\n## Statuses\r\n\r\n### Program Swap status\r\n\r\n```\r\nTradeStatus:\r\n    0 => Initializing\r\n    1 => WaitingToDeposit\r\n    2 => WaitingToClaim\r\n    3 => Closed\r\n\r\n    100 => Canceling\r\n    101 => Canceled\r\n```\r\n\r\n### Program Items status\r\n\r\n```\r\nItemStatus :\r\n    10 => NFTPending\r\n    11 => SolPending\r\n\r\n    20 => NFTDeposited\r\n    21 => SolDeposited\r\n    22 => SolToClaim\r\n\r\n    30 => NFTClaimed\r\n    31 => SolClaimed\r\n\r\n    100 => NFTcanceled\r\n    101 => Solcanceled\r\n\r\n    110 => NFTcanceledRecovered\r\n    111 => SolcanceledRecovered\r\n```\r\n\r\n### UserDataInSwap from UTILS.userSwapDetails\r\n\r\n```ts\r\ntype UserDataInSwap = {\r\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\r\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\r\n\r\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\r\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\r\n\r\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\r\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\r\n\r\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\r\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\r\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\r\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\r\n};\r\n```\r\n\r\n### Dummy data\r\n\r\n```ts\r\nlet swapInfo: neoTypes.SwapInfo = {\r\n    currency: \"usdcPublickey\",\r\n    preSeed: \"0035\",\r\n    users: [\r\n        {\r\n            address: \"user1Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: 50000 },\r\n            },\r\n        },\r\n        {\r\n            address: \"user2Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: -50000 },\r\n            },\r\n        },\r\n    ],\r\n};\r\n```\r\n\r\n<!-- MARKDOWN LINKS & IMAGES -->\r\n\r\n[neoswap-app]: https://www.neoswap.xyz\r\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\r\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\r\n","gitHead":"1a7c0584e841ed17ab597aff9e48da0154a6c881","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.20-beta_1710773538330_0.38921908537730343","host":"s3://npm-registry-packages"}},"0.3.20-beta1":{"name":"@neoswap/solana","version":"0.3.20-beta1","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.20-beta1","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"7f5401edbd4e9a0ab3df8fa1f79c5953b952fd32","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.20-beta1.tgz","fileCount":186,"integrity":"sha512-/A/dEPPkK+l1AWZ3Br2VQup0RMVHn7WLA6zgYDUdG1GpTNfag3rfIKD8Zc5IhEkXiXvj0zFmEP2naHSgVNSGww==","signatures":[{"sig":"MEQCIB+vZcmh2HT+n/5UTsvfXGw3zxQxWBrJFJdO7tJ/TprlAiBsXOEISKb03xpDEpyD0RKGx6+3B340LCTyyqZMNdYLVw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":910151},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\r\n<br />\r\n<div align=\"center\">\r\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\r\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\r\n  </a>\r\n\r\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\r\n\r\n</div>\r\n\r\n<!-- TABLE OF CONTENTS -->\r\n<details>\r\n  <summary>Table of Contents</summary>\r\n  <ol>\r\n    <li>\r\n      <a href=\"#about-the-project\">About The Project</a>\r\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\r\n\r\n    </li>\r\n    <li>\r\n      <a href=\"#Install-NPM-package\">Installation</a>\r\n\r\n    </li>\r\n    <li><a href=\"#usage\">Usage</a></li>\r\n\r\n  </ol>\r\n</details>\r\n\r\n<!-- ABOUT THE PROJECT -->\r\n\r\n## About The Project\r\n\r\n[Neoswap Website](https://neoswap.xyz/)\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Install NPM package\r\n\r\n```sh\r\nnpm install @neoswap/solana\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n<!-- USAGE EXAMPLES -->\r\n\r\n# Usage\r\n\r\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\r\n\r\n## Create Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\r\n} = await neoSwap.initializeSwap({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.swapInfo, // Data of the swap\r\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\r\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n});\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeSwapData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\r\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\r\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\r\n\r\n});\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\r\n    const transaction = initializeSwapData.transactions[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Deposit Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.depositSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet that will deposit in the swap\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        user: PublicKey, // User that will deposit assets in the swap\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\r\n    const transaction = depositTransactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Claim Swap\r\n\r\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\r\n\r\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.claimAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Cancel Swap (requires to be admin to finish closing accounts)\r\n\r\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\r\n\r\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\r\n\r\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\r\n\r\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.cancelAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\nimport { Transaction, Keypair } from \"@solana/web3.js\";\r\n\r\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\r\n\r\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\r\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\r\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\r\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\r\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\r\n\r\n});\r\n```\r\n\r\n## Types section\r\n\r\n### Types converter\r\n\r\n```ts\r\n\r\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \r\n\r\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\r\n\r\n```\r\n\r\n### Types\r\n\r\nswapInfo represents the Data of a swap in a human readable way\r\n\r\n```ts\r\ntype SwapInfo = {\r\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\r\n    preSeed?: string;\r\n    currency: string;\r\n    users: { address: string; items: SwapUserInfo }[];\r\n};\r\n```\r\n\r\nSwapUserInfo represents the data a user in a swap in a human readable way\r\n\r\n```ts\r\ntype SwapUserInfo = {\r\n    give: GiveSwapItem[];\r\n    get: GetSwapItem[];\r\n    token: { amount: number; status?: string };\r\n    status?:\r\n        | \"pending\"\r\n        | \"partiallyDeposited\"\r\n        | \"deposited\"\r\n        | \"partiallyClaimed\"\r\n        | \"claimed\"\r\n        | \"partiallyCanceled\"\r\n        | \"canceled\";\r\n};\r\n```\r\n\r\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\r\n\r\n```ts\r\ntype GiveSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    getters: {\r\n        address: string;\r\n        amount: number;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n\r\ntype GetSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    givers: {\r\n        amount: number;\r\n        address: string;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n```\r\n\r\nSwapIdentity represents the Identity of the swap\r\n\r\n```ts\r\ntype SwapIdentity = {\r\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\r\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\r\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\r\n    swapDataAccount_bump: number; // Bump of the PDA\r\n    swapData: SwapData; // Data of the swapDataAccount\r\n};\r\n```\r\n\r\nSwapData represents the data of the swap inside the PDA\r\n\r\n```ts\r\ntype SwapData = {\r\n    initializer: PublicKey;\r\n    status: number;\r\n    nbItems: number;\r\n    preSeed: string;\r\n    items: Array<NftSwapItem>;\r\n    acceptedPayement: PublicKey;\r\n};\r\n```\r\n\r\nNftSwapItem represents the data of one Item in SwapData\r\n\r\n```ts\r\ntype NftSwapItem = {\r\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\r\n    isNft: boolean; // true if the item is a NFT\r\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\r\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\r\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\r\n    amount: BN; // Amount of the item to be sent\r\n    owner: PublicKey; // Owner of the item\r\n    destinary: PublicKey; // Destinary of the item\r\n    status: number; // Status of the item\r\n};\r\n```\r\n\r\nInitializeData represents the data after initializing the swap\r\n\r\n```ts\r\ntype InitializeData = {\r\n    programId: string; // ProgramId of the solana program the swap is being deployed to\r\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\r\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\r\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\r\n};\r\n```\r\n\r\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\r\n\r\n```ts\r\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\r\n```\r\n\r\n## Error Type\r\n\r\nErrorFeedback represents the feedback thrown when an error is found\r\n\r\n```ts\r\ntype ErrorFeedback = {\r\n    blockchain: \"solana\";\r\n    status: \"error\";\r\n    message: string | unknown;\r\n    swapStatus?: number;\r\n};\r\n```\r\n\r\n## Statuses\r\n\r\n### Program Swap status\r\n\r\n```\r\nTradeStatus:\r\n    0 => Initializing\r\n    1 => WaitingToDeposit\r\n    2 => WaitingToClaim\r\n    3 => Closed\r\n\r\n    100 => Canceling\r\n    101 => Canceled\r\n```\r\n\r\n### Program Items status\r\n\r\n```\r\nItemStatus :\r\n    10 => NFTPending\r\n    11 => SolPending\r\n\r\n    20 => NFTDeposited\r\n    21 => SolDeposited\r\n    22 => SolToClaim\r\n\r\n    30 => NFTClaimed\r\n    31 => SolClaimed\r\n\r\n    100 => NFTcanceled\r\n    101 => Solcanceled\r\n\r\n    110 => NFTcanceledRecovered\r\n    111 => SolcanceledRecovered\r\n```\r\n\r\n### UserDataInSwap from UTILS.userSwapDetails\r\n\r\n```ts\r\ntype UserDataInSwap = {\r\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\r\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\r\n\r\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\r\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\r\n\r\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\r\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\r\n\r\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\r\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\r\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\r\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\r\n};\r\n```\r\n\r\n### Dummy data\r\n\r\n```ts\r\nlet swapInfo: neoTypes.SwapInfo = {\r\n    currency: \"usdcPublickey\",\r\n    preSeed: \"0035\",\r\n    users: [\r\n        {\r\n            address: \"user1Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: 50000 },\r\n            },\r\n        },\r\n        {\r\n            address: \"user2Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: -50000 },\r\n            },\r\n        },\r\n    ],\r\n};\r\n```\r\n\r\n<!-- MARKDOWN LINKS & IMAGES -->\r\n\r\n[neoswap-app]: https://www.neoswap.xyz\r\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\r\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\r\n","gitHead":"f29b01e2df5c4e4ce4cdcede0638483f55ad3076","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.20-beta1_1710773741789_0.47669514584503103","host":"s3://npm-registry-packages"}},"0.3.20-beta2":{"name":"@neoswap/solana","version":"0.3.20-beta2","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.20-beta2","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"0888e9a8a0f915ba9d15dd6324d3357bd3bd3d3c","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.20-beta2.tgz","fileCount":186,"integrity":"sha512-7XFfIjWoKBEAFf/m5jtkVX8ZuhU8u/yTZuMEPASCfWtlb6kj8T5+fW5K6B+grCRmX7qGMSP8bovtCJIx1HQxWw==","signatures":[{"sig":"MEUCIHJ3t50Jjcy4/J/W/ZeM8UZnVEZt53po7ByNvzW/w7SkAiEA/LK3kB5CTSl8/lG7ZSw5EK/E1L5xyveB5kitDMG5hu4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":911227},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\r\n<br />\r\n<div align=\"center\">\r\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\r\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\r\n  </a>\r\n\r\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\r\n\r\n</div>\r\n\r\n<!-- TABLE OF CONTENTS -->\r\n<details>\r\n  <summary>Table of Contents</summary>\r\n  <ol>\r\n    <li>\r\n      <a href=\"#about-the-project\">About The Project</a>\r\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\r\n\r\n    </li>\r\n    <li>\r\n      <a href=\"#Install-NPM-package\">Installation</a>\r\n\r\n    </li>\r\n    <li><a href=\"#usage\">Usage</a></li>\r\n\r\n  </ol>\r\n</details>\r\n\r\n<!-- ABOUT THE PROJECT -->\r\n\r\n## About The Project\r\n\r\n[Neoswap Website](https://neoswap.xyz/)\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Install NPM package\r\n\r\n```sh\r\nnpm install @neoswap/solana\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n<!-- USAGE EXAMPLES -->\r\n\r\n# Usage\r\n\r\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\r\n\r\n## Create Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\r\n} = await neoSwap.initializeSwap({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.swapInfo, // Data of the swap\r\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\r\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n});\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeSwapData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\r\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\r\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\r\n\r\n});\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\r\n    const transaction = initializeSwapData.transactions[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Deposit Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.depositSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet that will deposit in the swap\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        user: PublicKey, // User that will deposit assets in the swap\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\r\n    const transaction = depositTransactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Claim Swap\r\n\r\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\r\n\r\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.claimAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Cancel Swap (requires to be admin to finish closing accounts)\r\n\r\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\r\n\r\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\r\n\r\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\r\n\r\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.cancelAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\nimport { Transaction, Keypair } from \"@solana/web3.js\";\r\n\r\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\r\n\r\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\r\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\r\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\r\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\r\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\r\n\r\n});\r\n```\r\n\r\n## Types section\r\n\r\n### Types converter\r\n\r\n```ts\r\n\r\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \r\n\r\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\r\n\r\n```\r\n\r\n### Types\r\n\r\nswapInfo represents the Data of a swap in a human readable way\r\n\r\n```ts\r\ntype SwapInfo = {\r\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\r\n    preSeed?: string;\r\n    currency: string;\r\n    users: { address: string; items: SwapUserInfo }[];\r\n};\r\n```\r\n\r\nSwapUserInfo represents the data a user in a swap in a human readable way\r\n\r\n```ts\r\ntype SwapUserInfo = {\r\n    give: GiveSwapItem[];\r\n    get: GetSwapItem[];\r\n    token: { amount: number; status?: string };\r\n    status?:\r\n        | \"pending\"\r\n        | \"partiallyDeposited\"\r\n        | \"deposited\"\r\n        | \"partiallyClaimed\"\r\n        | \"claimed\"\r\n        | \"partiallyCanceled\"\r\n        | \"canceled\";\r\n};\r\n```\r\n\r\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\r\n\r\n```ts\r\ntype GiveSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    getters: {\r\n        address: string;\r\n        amount: number;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n\r\ntype GetSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    givers: {\r\n        amount: number;\r\n        address: string;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n```\r\n\r\nSwapIdentity represents the Identity of the swap\r\n\r\n```ts\r\ntype SwapIdentity = {\r\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\r\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\r\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\r\n    swapDataAccount_bump: number; // Bump of the PDA\r\n    swapData: SwapData; // Data of the swapDataAccount\r\n};\r\n```\r\n\r\nSwapData represents the data of the swap inside the PDA\r\n\r\n```ts\r\ntype SwapData = {\r\n    initializer: PublicKey;\r\n    status: number;\r\n    nbItems: number;\r\n    preSeed: string;\r\n    items: Array<NftSwapItem>;\r\n    acceptedPayement: PublicKey;\r\n};\r\n```\r\n\r\nNftSwapItem represents the data of one Item in SwapData\r\n\r\n```ts\r\ntype NftSwapItem = {\r\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\r\n    isNft: boolean; // true if the item is a NFT\r\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\r\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\r\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\r\n    amount: BN; // Amount of the item to be sent\r\n    owner: PublicKey; // Owner of the item\r\n    destinary: PublicKey; // Destinary of the item\r\n    status: number; // Status of the item\r\n};\r\n```\r\n\r\nInitializeData represents the data after initializing the swap\r\n\r\n```ts\r\ntype InitializeData = {\r\n    programId: string; // ProgramId of the solana program the swap is being deployed to\r\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\r\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\r\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\r\n};\r\n```\r\n\r\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\r\n\r\n```ts\r\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\r\n```\r\n\r\n## Error Type\r\n\r\nErrorFeedback represents the feedback thrown when an error is found\r\n\r\n```ts\r\ntype ErrorFeedback = {\r\n    blockchain: \"solana\";\r\n    status: \"error\";\r\n    message: string | unknown;\r\n    swapStatus?: number;\r\n};\r\n```\r\n\r\n## Statuses\r\n\r\n### Program Swap status\r\n\r\n```\r\nTradeStatus:\r\n    0 => Initializing\r\n    1 => WaitingToDeposit\r\n    2 => WaitingToClaim\r\n    3 => Closed\r\n\r\n    100 => Canceling\r\n    101 => Canceled\r\n```\r\n\r\n### Program Items status\r\n\r\n```\r\nItemStatus :\r\n    10 => NFTPending\r\n    11 => SolPending\r\n\r\n    20 => NFTDeposited\r\n    21 => SolDeposited\r\n    22 => SolToClaim\r\n\r\n    30 => NFTClaimed\r\n    31 => SolClaimed\r\n\r\n    100 => NFTcanceled\r\n    101 => Solcanceled\r\n\r\n    110 => NFTcanceledRecovered\r\n    111 => SolcanceledRecovered\r\n```\r\n\r\n### UserDataInSwap from UTILS.userSwapDetails\r\n\r\n```ts\r\ntype UserDataInSwap = {\r\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\r\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\r\n\r\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\r\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\r\n\r\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\r\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\r\n\r\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\r\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\r\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\r\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\r\n};\r\n```\r\n\r\n### Dummy data\r\n\r\n```ts\r\nlet swapInfo: neoTypes.SwapInfo = {\r\n    currency: \"usdcPublickey\",\r\n    preSeed: \"0035\",\r\n    users: [\r\n        {\r\n            address: \"user1Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: 50000 },\r\n            },\r\n        },\r\n        {\r\n            address: \"user2Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: -50000 },\r\n            },\r\n        },\r\n    ],\r\n};\r\n```\r\n\r\n<!-- MARKDOWN LINKS & IMAGES -->\r\n\r\n[neoswap-app]: https://www.neoswap.xyz\r\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\r\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\r\n","gitHead":"da8490cb4835c990ca09b015a51d9dbd4bc8e474","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.20-beta2_1710781830973_0.8916790305718418","host":"s3://npm-registry-packages"}},"0.3.20-beta3":{"name":"@neoswap/solana","version":"0.3.20-beta3","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.20-beta3","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"dd2f4464d3d8f8b2308610b6ee0dd05eae0ddb1a","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.20-beta3.tgz","fileCount":186,"integrity":"sha512-/ANoHphMYE45aHht/S+IP8vxm3K794vjZ9Z4evr+uzOuAtQdSH0DULfNVZZ8zLJxFJLkKicIVKPirLjEmu9QBw==","signatures":[{"sig":"MEUCIQCpc2QADwtF/vVSPCB1cOySrkv51FUmoceSe4k5MAj03wIgIjrhRfLtSu/5A3qE6tmjcbTa3aI+463COGCymtpPFq4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":910613},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","readme":"<!-- PROJECT LOGO -->\r\n<br />\r\n<div align=\"center\">\r\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\r\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\r\n  </a>\r\n\r\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\r\n\r\n</div>\r\n\r\n<!-- TABLE OF CONTENTS -->\r\n<details>\r\n  <summary>Table of Contents</summary>\r\n  <ol>\r\n    <li>\r\n      <a href=\"#about-the-project\">About The Project</a>\r\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\r\n\r\n    </li>\r\n    <li>\r\n      <a href=\"#Install-NPM-package\">Installation</a>\r\n\r\n    </li>\r\n    <li><a href=\"#usage\">Usage</a></li>\r\n\r\n  </ol>\r\n</details>\r\n\r\n<!-- ABOUT THE PROJECT -->\r\n\r\n## About The Project\r\n\r\n[Neoswap Website](https://neoswap.xyz/)\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Install NPM package\r\n\r\n```sh\r\nnpm install @neoswap/solana\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n<!-- USAGE EXAMPLES -->\r\n\r\n# Usage\r\n\r\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\r\n\r\n## Create Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\r\n} = await neoSwap.initializeSwap({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.swapInfo, // Data of the swap\r\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\r\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n});\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst initializeSwapData: {\r\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\r\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\r\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\r\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\r\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\r\n\r\n});\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\r\n    const transaction = initializeSwapData.transactions[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Deposit Swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.depositSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet that will deposit in the swap\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        user: PublicKey, // User that will deposit assets in the swap\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\r\n    const transaction = depositTransactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Claim Swap\r\n\r\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\r\n\r\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.claimAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Cancel Swap (requires to be admin to finish closing accounts)\r\n\r\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\r\n\r\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\r\n\r\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\r\n\r\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\r\n\r\n### With signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\r\n    await neoSwap.cancelAndCloseSwap({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\r\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n    });\r\n```\r\n\r\n### Without signer Keypair\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\n\r\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\r\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\r\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\r\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\r\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\r\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\r\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\r\n    });\r\n\r\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\r\n\r\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\r\n    const transaction = transactionsWithoutSigners[index].tx;\r\n\r\n    const hash = await provider.sendAndConfirm(transaction);\r\n}\r\n```\r\n\r\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\r\n\r\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\r\n\r\n```ts\r\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\r\nimport { Transaction, Keypair } from \"@solana/web3.js\";\r\n\r\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\r\n\r\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\r\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\r\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\r\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\r\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\r\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\r\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\r\n\r\n});\r\n```\r\n\r\n## Types section\r\n\r\n### Types converter\r\n\r\n```ts\r\n\r\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \r\n\r\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\r\n\r\n```\r\n\r\n### Types\r\n\r\nswapInfo represents the Data of a swap in a human readable way\r\n\r\n```ts\r\ntype SwapInfo = {\r\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\r\n    preSeed?: string;\r\n    currency: string;\r\n    users: { address: string; items: SwapUserInfo }[];\r\n};\r\n```\r\n\r\nSwapUserInfo represents the data a user in a swap in a human readable way\r\n\r\n```ts\r\ntype SwapUserInfo = {\r\n    give: GiveSwapItem[];\r\n    get: GetSwapItem[];\r\n    token: { amount: number; status?: string };\r\n    status?:\r\n        | \"pending\"\r\n        | \"partiallyDeposited\"\r\n        | \"deposited\"\r\n        | \"partiallyClaimed\"\r\n        | \"claimed\"\r\n        | \"partiallyCanceled\"\r\n        | \"canceled\";\r\n};\r\n```\r\n\r\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\r\n\r\n```ts\r\ntype GiveSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    getters: {\r\n        address: string;\r\n        amount: number;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n\r\ntype GetSwapItem = {\r\n    address: string;\r\n    amount: number;\r\n    givers: {\r\n        amount: number;\r\n        address: string;\r\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\r\n    }[];\r\n};\r\n```\r\n\r\nSwapIdentity represents the Identity of the swap\r\n\r\n```ts\r\ntype SwapIdentity = {\r\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\r\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\r\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\r\n    swapDataAccount_bump: number; // Bump of the PDA\r\n    swapData: SwapData; // Data of the swapDataAccount\r\n};\r\n```\r\n\r\nSwapData represents the data of the swap inside the PDA\r\n\r\n```ts\r\ntype SwapData = {\r\n    initializer: PublicKey;\r\n    status: number;\r\n    nbItems: number;\r\n    preSeed: string;\r\n    items: Array<NftSwapItem>;\r\n    acceptedPayement: PublicKey;\r\n};\r\n```\r\n\r\nNftSwapItem represents the data of one Item in SwapData\r\n\r\n```ts\r\ntype NftSwapItem = {\r\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\r\n    isNft: boolean; // true if the item is a NFT\r\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\r\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\r\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\r\n    amount: BN; // Amount of the item to be sent\r\n    owner: PublicKey; // Owner of the item\r\n    destinary: PublicKey; // Destinary of the item\r\n    status: number; // Status of the item\r\n};\r\n```\r\n\r\nInitializeData represents the data after initializing the swap\r\n\r\n```ts\r\ntype InitializeData = {\r\n    programId: string; // ProgramId of the solana program the swap is being deployed to\r\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\r\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\r\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\r\n};\r\n```\r\n\r\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\r\n\r\n```ts\r\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\r\n```\r\n\r\n## Error Type\r\n\r\nErrorFeedback represents the feedback thrown when an error is found\r\n\r\n```ts\r\ntype ErrorFeedback = {\r\n    blockchain: \"solana\";\r\n    status: \"error\";\r\n    message: string | unknown;\r\n    swapStatus?: number;\r\n};\r\n```\r\n\r\n## Statuses\r\n\r\n### Program Swap status\r\n\r\n```\r\nTradeStatus:\r\n    0 => Initializing\r\n    1 => WaitingToDeposit\r\n    2 => WaitingToClaim\r\n    3 => Closed\r\n\r\n    100 => Canceling\r\n    101 => Canceled\r\n```\r\n\r\n### Program Items status\r\n\r\n```\r\nItemStatus :\r\n    10 => NFTPending\r\n    11 => SolPending\r\n\r\n    20 => NFTDeposited\r\n    21 => SolDeposited\r\n    22 => SolToClaim\r\n\r\n    30 => NFTClaimed\r\n    31 => SolClaimed\r\n\r\n    100 => NFTcanceled\r\n    101 => Solcanceled\r\n\r\n    110 => NFTcanceledRecovered\r\n    111 => SolcanceledRecovered\r\n```\r\n\r\n### UserDataInSwap from UTILS.userSwapDetails\r\n\r\n```ts\r\ntype UserDataInSwap = {\r\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\r\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\r\n\r\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\r\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\r\n\r\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\r\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\r\n\r\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\r\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\r\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\r\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\r\n};\r\n```\r\n\r\n### Dummy data\r\n\r\n```ts\r\nlet swapInfo: neoTypes.SwapInfo = {\r\n    currency: \"usdcPublickey\",\r\n    preSeed: \"0035\",\r\n    users: [\r\n        {\r\n            address: \"user1Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: 50000 },\r\n            },\r\n        },\r\n        {\r\n            address: \"user2Publickey\",\r\n            items: {\r\n                give: [\r\n                    {\r\n                        address: \"mint3\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint5\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint4\",\r\n                        amount: 1,\r\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                get: [\r\n                    {\r\n                        address: \"mint1\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                    {\r\n                        address: \"mint2\",\r\n                        amount: 1,\r\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\r\n                    },\r\n                ],\r\n                token: { amount: -50000 },\r\n            },\r\n        },\r\n    ],\r\n};\r\n```\r\n\r\n<!-- MARKDOWN LINKS & IMAGES -->\r\n\r\n[neoswap-app]: https://www.neoswap.xyz\r\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\r\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\r\n","gitHead":"87954419dbded2b49ea2c0e31b4e78c3d6668cd0","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/solana_0.3.20-beta3_1710784004571_0.011244742911735717","host":"s3://npm-registry-packages"}},"0.3.21":{"name":"@neoswap/solana","version":"0.3.21","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.21","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"60ba5c9c696095c8714ecead6a9a80f0314f77bf","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.21.tgz","fileCount":186,"integrity":"sha512-XGz7QWZHeGQHR7eGBs5JiDUPc0UHDi+9o3tdm4VuDzv8I0zSiG3C0RBhG4Ln1ePG4JmWq/FzNpitRTYsyanGxg==","signatures":[{"sig":"MEUCIQDXolfGQ8tzxgEB08tbYPKtTvfRv05Ftaxr0PaBR0W70wIgWEEXYvnqAWOzTh35mTt/4Q/xUL3wGe+3+m7l//J5XGI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":910607},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"a72e9eff6bfcb92b21284eaf847a6a1829eb4275","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.21_1710886108575_0.5209651179854677","host":"s3://npm-registry-packages"}},"0.3.23":{"name":"@neoswap/solana","version":"0.3.23","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.23","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"de317c0c304d0313920022815f464aef217f37b9","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.23.tgz","fileCount":186,"integrity":"sha512-L1at/FTU7OVwh5j+C11H78lziv/TeVE+0WRtHXM+f9VqCZ8s2AKltSxfd0xHY/LptlzetVkV6sxg1M74Svzwjw==","signatures":[{"sig":"MEYCIQCIxKd0Ajj74CTQ7OXwr7rUlfj9Z0p1shG1aS+RgtsHowIhANRdKx7BTXDiSZxsCAKEK0EAb4fKoLT0ZgFw5RF0jnBy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":910690},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"c367537a3e4a2f2ad8cfbaf36e9bb22d73e522e5","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json","updateLink":"npm run compile && npm rm @neoswap/solana -g && npm link"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.23_1710959933890_0.5709033541662751","host":"s3://npm-registry-packages"}},"0.3.24":{"name":"@neoswap/solana","version":"0.3.24","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.24","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"b9b4167a92e9dfc1b01681b2645e9f23c5550c2f","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.24.tgz","fileCount":186,"integrity":"sha512-8NgSpCUyzKvVCoS6ZjQ6wXxm8l9mxWHLYUqAfCWimFmUmeld4K4GqhMWzamr2TgnTMAwEBrwrl62LGx291c7wQ==","signatures":[{"sig":"MEYCIQD6ptkZb5YyOW/ETmdBcFJ1hndkOvTZhhHiTAoI/0mQDAIhAJPXl+WnmTVNjrUvraSVCjX7FemHlVfEFWp70ci7PMv2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":921485},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"18033e079e24463c0c14d552884f052b01378a58","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json","updateLink":"npm run compile && npm rm @neoswap/solana -g && npm link"},"_npmUser":{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.3.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"18.14.0","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.24_1711011316461_0.465135811820911","host":"s3://npm-registry-packages"}},"0.3.25":{"name":"@neoswap/solana","version":"0.3.25","author":{"name":"NeoSwap"},"license":"MIT","_id":"@neoswap/solana@0.3.25","maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"dist":{"shasum":"5b57e31328ba38e3ebc4b50b968334df7ee3ce9b","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.25.tgz","fileCount":186,"integrity":"sha512-pSwla/VOsAdam9xjwH4jqZHvfbMQbDq0NohKjTDxFkaFikPtQSdE3WIgHavZSGAU9g7HF6G75IBcZmD/r9rveg==","signatures":[{"sig":"MEUCIDv76nbQfQkxuRFQAw2EMATT88x8Zv8rIKPVXvmLRV7hAiEA/H8Hb900cgLwu5ZzM9fYaJGGBhQYT3a7y6dkWbQ8knQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":903091},"main":"./dist/lib/es5/index.js","types":"./dist/lib/es5/index.d.ts","module":"./dist/lib/es6/index.js","gitHead":"03e4ba6b807a0ced1add0a09c79ecbfa4ece7565","scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json","updateLink":"npm run compile && npm rm @neoswap/solana -g && npm link"},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"repository":{"url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git","type":"git"},"_npmVersion":"9.8.1","description":"NPM package for NeoSwap test","directories":{},"sideEffects":false,"_nodeVersion":"16.20.1","dependencies":{"bs58":"^5.0.0","parcel":"^2.5.0","typescript":"^4.6.3","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@solana/web3.js":"^1.66.2","@coral-xyz/anchor":"^0.28.0","@solana/spl-token":"^0.3.7","@types/node-fetch":"^2.6.4","@project-serum/anchor":"^0.26.0","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/solana_0.3.25_1717772689637_0.7728964216308527","host":"s3://npm-registry-packages"}},"0.3.26":{"name":"@neoswap/solana","version":"0.3.26","repository":{"type":"git","url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git"},"description":"NPM package for NeoSwap test","author":{"name":"NeoSwap"},"license":"MIT","main":"./dist/lib/es5/index.js","module":"./dist/lib/es6/index.js","sideEffects":false,"scripts":{"compile":"rm -rf dist/lib && tsc && tsc --build tsconfig.es5.json","updateLink":"npm run compile && npm rm @neoswap/solana -g && npm link"},"dependencies":{"@coral-xyz/anchor":"^0.28.0","@metaplex-foundation/beet":"^0.7.1","@metaplex-foundation/js":"^0.19.5","@metaplex-foundation/mpl-bubblegum":"^0.8.0","@metaplex-foundation/mpl-token-metadata":"^2.11.1","@metaplex-foundation/mpl-toolbox":"^0.9.1","@project-serum/anchor":"^0.26.0","@solana/spl-token":"^0.3.7","@solana/web3.js":"^1.66.2","@types/bn.js":"^5.1.1","@types/debug":"^4.1.8","@types/node-fetch":"^2.6.4","bs58":"^5.0.0","typescript":"^4.6.3"},"types":"./dist/lib/es5/index.d.ts","gitHead":"c3e8eb0864879b1aa642742bb8f7f391872f6cff","_id":"@neoswap/solana@0.3.26","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-SpESB0Rh/bijOqgwUaWU63DRNP2/C1I4UumtNCNK8cg4FmPqRRZ29g5V9fAIe8cYwlzLF9cnKA7vzlshzzyOGw==","shasum":"de1133df9c26a4b441d2379d97040b1b649ea812","tarball":"https://registry.npmjs.org/@neoswap/solana/-/solana-0.3.26.tgz","fileCount":186,"unpackedSize":903063,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB+7SB8E3TEHXYwnOdb9FfKtVxz+XELAuzjU7cnlTuBdAiBHVBUrS9qZYr7UL+AIw+bz6KchxfvLYIBxastPd/vy9w=="}]},"_npmUser":{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},"directories":{},"maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/solana_0.3.26_1718290570129_0.04703094302179989"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-05T08:07:43.661Z","modified":"2024-06-13T14:56:10.575Z","0.0.1":"2023-07-05T08:07:43.984Z","0.0.2":"2023-07-05T09:35:49.044Z","0.0.3":"2023-07-05T12:44:23.096Z","0.0.4":"2023-07-05T14:10:06.314Z","0.0.5":"2023-07-05T16:45:37.629Z","0.0.6":"2023-07-05T16:47:25.897Z","0.0.8":"2023-07-05T18:09:42.975Z","0.0.9":"2023-07-05T23:23:03.519Z","0.0.10":"2023-07-05T23:58:00.909Z","0.0.11":"2023-07-06T00:35:01.785Z","0.0.12":"2023-07-06T07:43:20.951Z","0.0.100":"2023-07-06T12:43:23.115Z","0.0.101":"2023-07-06T12:54:51.606Z","0.0.102":"2023-07-06T15:07:09.745Z","0.0.103":"2023-07-06T15:23:50.990Z","0.0.104":"2023-07-06T15:41:22.293Z","0.0.105":"2023-07-06T16:00:53.765Z","0.0.106":"2023-07-06T16:32:23.095Z","0.0.107":"2023-07-06T16:49:48.800Z","0.0.108":"2023-07-06T17:36:10.449Z","0.0.109":"2023-07-06T17:44:43.099Z","0.0.110":"2023-07-06T18:05:25.961Z","0.0.111":"2023-07-07T01:49:39.938Z","0.0.112":"2023-07-07T02:03:32.063Z","0.0.113":"2023-07-07T03:16:47.545Z","0.0.114":"2023-07-07T03:29:15.440Z","0.0.115":"2023-07-07T03:54:18.429Z","0.0.116":"2023-07-07T04:02:41.626Z","0.0.117":"2023-07-07T05:53:11.487Z","0.0.118":"2023-07-07T06:04:22.803Z","0.0.119":"2023-07-07T06:12:08.680Z","0.0.120":"2023-07-07T06:15:24.837Z","0.0.121":"2023-07-07T06:17:35.938Z","0.0.122":"2023-07-07T06:20:05.860Z","0.0.123":"2023-07-07T06:21:04.261Z","0.0.124":"2023-07-07T06:22:16.934Z","0.0.125":"2023-07-07T06:23:15.262Z","0.0.126":"2023-07-07T06:26:33.144Z","0.0.127":"2023-07-07T06:28:25.232Z","0.0.128":"2023-07-07T07:27:20.813Z","0.0.129":"2023-07-07T07:35:02.262Z","0.0.130":"2023-07-07T07:38:46.878Z","0.0.131":"2023-07-07T07:43:15.101Z","0.0.132":"2023-07-07T07:57:09.213Z","0.0.133":"2023-07-07T07:57:54.266Z","0.0.134":"2023-07-07T07:58:55.968Z","0.0.135":"2023-07-07T07:59:59.989Z","0.0.136":"2023-07-07T08:02:16.678Z","0.0.137":"2023-07-07T08:03:53.807Z","0.1.0":"2023-07-07T08:08:01.553Z","0.0.13":"2023-07-13T11:36:14.731Z","0.0.14":"2023-07-13T11:59:34.229Z","0.0.15":"2023-07-13T12:33:43.783Z","0.0.16":"2023-07-13T12:38:16.875Z","0.0.17":"2023-07-13T13:09:40.147Z","0.0.18":"2023-07-13T13:22:21.120Z","0.0.19":"2023-07-13T15:11:22.039Z","0.0.20":"2023-07-13T17:25:07.772Z","0.0.21":"2023-07-13T17:35:57.457Z","0.0.22":"2023-07-13T17:43:49.541Z","0.0.23":"2023-07-13T18:10:17.990Z","0.2.0":"2023-07-17T11:06:36.919Z","0.2.1":"2023-07-17T12:02:06.477Z","0.2.2":"2023-07-17T12:27:17.264Z","0.2.3":"2023-07-17T13:31:38.879Z","0.2.4":"2023-07-17T13:57:41.545Z","0.2.5":"2023-07-18T12:23:37.949Z","0.2.6":"2023-07-18T12:25:05.188Z","0.2.7":"2023-07-18T12:25:55.249Z","0.2.8":"2023-07-18T12:28:19.885Z","0.2.9":"2023-07-20T10:22:48.116Z","0.2.10":"2023-07-20T10:34:14.171Z","0.2.11":"2023-07-20T12:14:28.893Z","0.2.12":"2023-07-21T08:17:23.397Z","0.2.13":"2023-07-21T08:50:52.789Z","0.2.14":"2023-07-21T10:29:20.201Z","0.2.15":"2023-07-21T14:51:03.264Z","0.2.16":"2023-07-24T11:26:06.812Z","0.2.17":"2023-07-24T11:43:00.583Z","0.2.18":"2023-07-26T08:52:25.715Z","0.2.19":"2023-07-26T10:29:18.738Z","0.2.20":"2023-07-26T12:07:17.378Z","0.2.21":"2023-07-27T09:57:57.858Z","0.2.22":"2023-07-27T10:06:13.019Z","0.2.23":"2023-07-27T10:11:13.478Z","0.2.24":"2023-07-27T10:14:05.050Z","0.2.25":"2023-07-27T10:14:52.905Z","0.2.26":"2023-07-27T13:02:59.831Z","0.2.27":"2023-07-27T13:49:03.763Z","0.2.28":"2023-07-27T14:21:48.490Z","0.2.29":"2023-07-27T14:47:38.372Z","0.2.30":"2023-07-27T15:16:58.723Z","0.2.31":"2023-07-27T16:16:50.384Z","0.2.32":"2023-07-27T16:23:14.185Z","0.2.33":"2023-07-27T17:11:59.035Z","0.2.34":"2023-07-27T20:44:50.777Z","0.2.100":"2023-08-04T07:37:47.111Z","0.2.101":"2023-08-04T10:59:03.729Z","0.2.102":"2023-08-07T11:51:07.253Z","0.2.103":"2023-08-07T11:59:44.775Z","0.2.104":"2023-08-07T12:15:00.941Z","0.2.105":"2023-08-07T12:29:47.898Z","0.2.106":"2023-08-07T12:51:13.878Z","0.2.107":"2023-08-07T13:14:48.353Z","0.2.108":"2023-08-07T13:58:09.144Z","0.2.109":"2023-08-07T14:02:02.344Z","0.2.110":"2023-08-07T14:10:24.086Z","0.2.111":"2023-08-07T14:15:40.836Z","0.2.200":"2023-08-08T08:06:11.063Z","0.2.201":"2023-08-08T09:12:43.430Z","0.2.35":"2023-08-08T10:03:18.133Z","0.2.36":"2023-08-11T11:59:23.805Z","0.2.36-beta.0":"2023-08-11T12:02:26.680Z","0.2.36-beta.1":"2023-08-11T12:10:36.074Z","0.2.37":"2023-08-11T12:19:58.282Z","0.2.38":"2023-08-11T14:26:25.665Z","0.2.38-beta.0":"2023-08-11T14:27:56.940Z","0.2.38-beta.1":"2023-08-11T14:29:23.256Z","0.2.39":"2023-08-11T14:30:51.480Z","0.2.40-beta.0":"2023-08-14T16:23:52.104Z","0.2.40-beta.1":"2023-08-14T16:23:57.811Z","0.2.40-beta.2":"2023-08-14T16:34:09.595Z","0.2.41":"2023-08-14T16:43:59.198Z","0.2.40-beta.3":"2023-08-14T16:57:53.319Z","0.2.40-beta.4":"2023-08-14T16:59:26.575Z","0.2.40-beta.5":"2023-08-14T17:03:56.904Z","0.2.40-beta.6":"2023-08-14T17:06:07.276Z","0.2.40-beta.7":"2023-08-14T17:08:26.681Z","0.2.40-beta.8":"2023-08-14T17:11:23.868Z","0.2.42":"2023-08-14T17:13:21.349Z","0.2.43":"2023-08-14T17:14:40.559Z","0.2.44-beta.0":"2023-08-14T18:34:52.913Z","0.2.44-beta.1":"2023-08-14T18:40:56.957Z","0.2.44-beta.2":"2023-08-14T19:10:58.300Z","0.2.44-beta.3":"2023-08-14T19:15:57.662Z","0.2.45":"2023-08-14T21:08:58.114Z","0.2.46":"2023-08-18T05:08:49.048Z","0.2.47":"2023-08-18T06:50:56.622Z","0.2.48":"2023-08-18T12:02:24.776Z","0.2.49-beta.0":"2023-08-23T10:11:28.374Z","0.2.49-beta.1":"2023-08-23T10:30:59.801Z","0.2.49":"2023-08-23T12:58:32.442Z","0.2.5-0.beta0":"2023-09-04T12:18:44.551Z","0.2.50-beta0":"2023-09-04T12:19:47.502Z","0.3.0-beta0":"2023-09-11T06:43:07.054Z","0.3.0-beta1":"2023-09-11T12:29:20.629Z","0.3.0-beta2":"2023-09-12T04:39:39.277Z","0.3.0-beta3":"2023-09-12T08:30:03.123Z","0.3.0-beta4":"2023-09-12T08:35:25.690Z","0.3.0-beta5":"2023-09-12T08:42:22.737Z","0.3.0-beta6":"2023-09-12T08:44:43.587Z","0.3.0-beta7":"2023-09-12T08:47:23.355Z","0.3.0-beta8":"2023-09-12T08:49:10.653Z","0.3.0-beta9":"2023-09-12T08:55:13.671Z","0.3.0-beta10":"2023-09-12T08:57:18.539Z","0.3.0-beta11":"2023-09-12T09:10:18.544Z","0.3.0-beta12":"2023-09-12T09:25:30.956Z","0.3.0-beta14":"2023-09-12T09:47:27.484Z","0.3.0-beta15":"2023-09-12T09:55:01.204Z","0.3.0-beta17":"2023-09-12T09:58:03.114Z","0.3.0-beta18":"2023-09-12T10:00:24.848Z","0.3.0-beta19":"2023-09-12T10:03:38.213Z","0.3.0-beta20":"2023-09-12T10:18:51.240Z","0.3.0-beta21":"2023-09-12T10:28:52.909Z","0.3.0-beta22":"2023-09-12T10:33:23.356Z","0.3.0-beta23":"2023-09-12T11:37:23.697Z","0.3.0-beta24":"2023-09-12T13:09:45.111Z","0.3.0-beta25":"2023-09-12T13:23:23.619Z","0.3.0-beta27":"2023-09-14T07:28:02.375Z","0.3.0-beta28":"2023-09-14T08:13:28.621Z","0.3.0-beta29":"2023-09-14T12:01:10.807Z","0.3.0-beta30":"2023-09-14T12:05:32.602Z","0.3.0-beta31":"2023-09-14T13:16:30.635Z","0.3.0-beta32":"2023-09-14T13:22:02.171Z","0.3.0-beta33":"2023-09-14T13:22:18.638Z","0.3.0-beta34":"2023-09-14T13:25:35.599Z","0.3.0-beta35":"2023-09-14T13:29:52.441Z","0.3.0-beta36":"2023-09-14T13:31:56.321Z","0.3.0-beta37":"2023-09-14T13:36:15.653Z","0.3.0-beta38":"2023-09-14T14:05:09.055Z","0.3.0-beta39":"2023-09-14T14:22:20.876Z","0.3.0-beta40":"2023-09-14T14:25:29.074Z","0.3.0-beta41":"2023-09-14T14:27:13.152Z","0.3.0-beta42":"2023-09-14T14:36:41.744Z","0.3.0-beta43":"2023-09-14T14:38:11.937Z","0.3.0-beta44":"2023-09-14T14:59:36.433Z","0.3.0-beta45":"2023-09-14T15:10:52.804Z","0.3.0-beta46":"2023-09-14T15:19:08.737Z","0.3.0-beta47":"2023-09-14T16:00:19.988Z","0.3.0-beta48":"2023-09-14T16:10:44.613Z","0.3.0-beta49":"2023-09-14T16:17:52.921Z","0.3.0-beta50":"2023-09-14T16:19:35.342Z","0.3.0-beta51":"2023-09-14T16:21:19.018Z","0.3.0-beta52":"2023-09-14T16:23:14.917Z","0.3.0-beta53":"2023-09-14T17:09:13.495Z","0.3.0-beta54":"2023-09-14T17:15:20.585Z","0.3.0-beta55":"2023-09-14T17:21:00.843Z","0.3.0-beta56":"2023-09-14T17:27:37.812Z","0.3.0-beta57":"2023-09-14T17:30:53.351Z","0.3.0-beta58":"2023-09-14T17:32:08.765Z","0.3.0-beta59":"2023-09-14T17:34:38.385Z","0.3.0-beta60":"2023-09-14T17:43:04.245Z","0.3.0-beta61":"2023-09-14T17:49:18.083Z","0.3.0-beta62":"2023-09-14T17:57:02.989Z","0.3.0-beta63":"2023-09-14T18:05:18.974Z","0.3.0-beta64":"2023-09-14T18:06:58.372Z","0.3.0-beta65":"2023-09-14T18:09:22.574Z","0.3.0-beta66":"2023-09-15T03:59:40.771Z","0.3.0-beta67":"2023-09-15T04:06:40.273Z","0.3.0-beta68":"2023-09-15T05:43:08.241Z","0.3.0-beta69":"2023-09-15T05:45:27.453Z","0.3.0-beta70":"2023-09-15T05:47:31.409Z","0.3.0-beta71":"2023-09-15T05:55:38.950Z","0.3.0-beta72":"2023-09-15T06:26:44.763Z","0.3.0-beta73":"2023-09-15T06:33:44.812Z","0.3.0-beta74":"2023-09-15T06:36:31.806Z","0.3.0-beta75":"2023-09-15T06:52:01.909Z","0.3.0-beta77":"2023-09-15T06:54:10.119Z","0.3.0-beta78":"2023-09-15T06:57:51.387Z","0.3.0-beta79":"2023-09-15T07:02:12.472Z","0.3.0-beta80":"2023-09-15T07:03:26.055Z","0.3.0-beta81":"2023-09-15T07:07:01.532Z","0.3.0-beta83":"2023-09-15T13:08:52.299Z","0.3.0-beta85":"2023-09-19T08:37:13.836Z","0.3.0-beta86":"2023-09-19T11:53:18.859Z","0.3.0-beta87":"2023-09-19T12:48:40.914Z","0.3.0-beta88":"2023-09-19T12:58:53.095Z","0.3.0-beta89":"2023-09-19T13:26:05.827Z","0.3.0-beta90":"2023-09-19T13:34:12.877Z","0.3.0-beta91":"2023-09-19T14:21:00.550Z","0.3.0-beta92":"2023-09-19T16:18:00.429Z","0.3.0-beta93":"2023-09-21T12:13:09.400Z","0.3.0":"2023-09-21T12:42:46.525Z","0.3.1-beta0":"2023-09-21T15:18:12.908Z","0.3.1-beta1":"2023-09-21T15:22:37.527Z","0.3.1-beta2":"2023-09-21T15:23:42.452Z","0.3.1-beta3":"2023-09-21T15:33:37.401Z","0.3.1":"2023-09-21T15:49:43.079Z","0.3.2":"2023-09-25T09:10:34.161Z","0.3.3":"2023-09-26T10:26:57.554Z","0.3.4":"2023-09-26T12:10:42.857Z","0.3.5":"2023-09-29T10:35:13.321Z","0.3.6-Beta0":"2023-10-12T06:35:44.523Z","0.3.6-Beta1":"2023-10-12T16:56:14.889Z","0.3.6-Beta2":"2023-10-12T17:13:04.372Z","0.3.6-Beta3":"2023-10-12T17:14:58.553Z","0.3.6-Beta4":"2023-10-12T17:28:48.789Z","0.3.6-Beta5":"2023-10-12T17:38:32.682Z","0.3.6-Beta6":"2023-10-12T17:42:14.576Z","0.3.6-Beta7":"2023-10-12T17:58:11.525Z","0.3.6-Beta8":"2023-10-12T18:01:40.664Z","0.3.6-Beta9":"2023-10-12T18:07:30.649Z","0.3.6-Beta11":"2023-10-12T18:15:12.453Z","0.3.6-Beta12":"2023-10-12T18:17:16.966Z","0.3.6-Beta13":"2023-10-12T18:20:10.677Z","0.3.6-Beta14":"2023-10-12T18:54:47.008Z","0.3.6-Beta15":"2023-10-12T19:58:35.238Z","0.3.6-Beta16":"2023-10-12T21:07:18.308Z","0.3.6-Beta17":"2023-10-12T22:09:28.628Z","0.3.6-Beta18":"2023-10-17T02:06:38.048Z","0.3.6-Beta19":"2023-10-17T02:12:23.164Z","0.3.6-Beta20":"2023-10-17T02:16:08.771Z","0.3.6-Beta21":"2023-10-17T05:32:03.600Z","0.3.6-Beta22":"2023-10-17T05:33:04.102Z","0.3.6-Beta23":"2023-10-17T05:35:40.481Z","0.3.6-Beta24":"2023-10-17T05:36:47.546Z","0.3.6-Beta25":"2023-10-17T05:37:36.058Z","0.3.6-Beta26":"2023-10-17T06:00:05.975Z","0.3.6-Beta27":"2023-10-17T06:16:12.180Z","0.3.6-Beta28":"2023-10-17T06:20:58.412Z","0.3.6-Beta29":"2023-10-17T06:21:50.793Z","0.3.6-Beta30":"2023-10-17T06:29:52.091Z","0.3.6-Beta31":"2023-10-17T06:30:48.397Z","0.3.6-Beta32":"2023-10-17T06:33:44.803Z","0.3.6-Beta33":"2023-10-17T06:35:31.795Z","0.3.6-Beta34":"2023-10-17T06:44:30.947Z","0.3.6-Beta35":"2023-10-17T06:44:52.214Z","0.3.6-Beta36":"2023-10-17T06:47:42.915Z","0.3.6-Beta37":"2023-10-17T06:50:08.979Z","0.3.6-Beta38":"2023-10-17T11:00:57.466Z","0.3.6-Beta39":"2023-10-17T11:09:41.432Z","0.3.6":"2023-10-19T03:00:21.151Z","0.3.7-beta0":"2023-10-25T14:06:57.429Z","0.3.7-beta1":"2023-10-25T16:20:07.703Z","0.3.7-beta2":"2023-10-26T03:19:52.734Z","0.3.7-beta3":"2023-10-26T03:34:31.186Z","0.3.7-beta4":"2023-10-26T03:47:16.892Z","0.3.7-beta5":"2023-10-26T03:56:39.631Z","0.3.7-beta6":"2023-10-26T04:06:47.028Z","0.3.7-beta7":"2023-10-26T04:13:34.403Z","0.3.7-beta8":"2023-10-27T12:46:50.860Z","0.3.7-beta9":"2023-10-27T12:54:13.029Z","0.3.7-beta10":"2023-10-27T12:57:35.795Z","0.3.7-beta11":"2023-11-13T18:34:15.431Z","0.3.7":"2023-11-13T18:34:45.663Z","0.3.8-beta0":"2023-11-13T22:06:21.782Z","0.3.8":"2023-11-13T22:08:46.354Z","0.3.9-beta1":"2023-11-14T20:16:19.761Z","0.3.9-beta2":"2023-11-14T22:56:41.083Z","0.3.9-beta3":"2023-11-14T23:15:34.667Z","0.3.9-beta4":"2023-11-14T23:31:20.024Z","0.3.9-beta5":"2023-11-14T23:41:34.063Z","0.3.9-beta6":"2023-11-14T23:50:18.469Z","0.3.9-beta7":"2023-11-14T23:54:16.951Z","0.3.9-beta8":"2023-11-14T23:55:52.481Z","0.3.9":"2023-12-22T12:23:16.642Z","0.3.10":"2023-12-22T15:00:59.920Z","0.3.11":"2024-01-09T12:36:53.137Z","0.3.12":"2024-03-17T13:27:36.650Z","0.3.13":"2024-03-17T14:17:54.991Z","0.3.14":"2024-03-17T14:34:26.678Z","0.3.15":"2024-03-17T14:41:40.301Z","0.3.16":"2024-03-17T18:20:55.833Z","0.3.17-beta":"2024-03-18T00:11:13.826Z","0.3.17-beta1":"2024-03-18T00:14:46.086Z","0.3.18-beta":"2024-03-18T00:19:23.352Z","0.3.19-beta":"2024-03-18T00:23:09.002Z","0.3.20-beta":"2024-03-18T14:52:18.517Z","0.3.20-beta1":"2024-03-18T14:55:42.036Z","0.3.20-beta2":"2024-03-18T17:10:31.162Z","0.3.20-beta3":"2024-03-18T17:46:44.764Z","0.3.21":"2024-03-19T22:08:28.807Z","0.3.23":"2024-03-20T18:38:54.080Z","0.3.24":"2024-03-21T08:55:16.616Z","0.3.25":"2024-06-07T15:04:49.903Z","0.3.26":"2024-06-13T14:56:10.344Z"},"maintainers":[{"name":"gustavo-neoswap","email":"gustavo@neoswap.ai"},{"name":"biboux.neoswap","email":"biboux.esmail@neoswap.ai"},{"name":"kuba-neoswap","email":"kuba.kwiecien@neoswap.ai"},{"name":"admin-neoswap","email":"ns-ext-saas-npm@neoswap.ai"}],"author":{"name":"NeoSwap"},"repository":{"type":"git","url":"git+htt// Data after initializing the swapps://github.com/neoswap-ai/neo-swap-npm.git"},"license":"MIT","readme":"<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://neoswap.ai/wp-content/uploads/2022/08/logo-small-2.png\">\n    <img src=\"https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\" alt=\"Logo\">\n  </a>\n\n  <h3 align=\"center\">NeoSwap Solana Package</h3>\n\n</div>\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li>\n      <a href=\"#about-the-project\">About The Project</a>\n      <a href=\"#Install-NPM-package\">Install NPM package</a>\n\n    </li>\n    <li>\n      <a href=\"#Install-NPM-package\">Installation</a>\n\n    </li>\n    <li><a href=\"#usage\">Usage</a></li>\n\n  </ol>\n</details>\n\n<!-- ABOUT THE PROJECT -->\n\n## About The Project\n\n[Neoswap Website](https://neoswap.xyz/)\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Install NPM package\n\n```sh\nnpm install @neoswap/solana\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n<!-- USAGE EXAMPLES -->\n\n# Usage\n\nExamples can be found in the examples folder [https://github.com/neoswap-ai/neo-swap-npm/tree/cNFT/examples](Examples)\n\n## Create Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n    transactionHashs: string[]; // Array of string containing the hashes of the executed transactions\n} = await neoSwap.initializeSwap({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.swapInfo, // Data of the swap\n    signer: Keypair, // Wallet that will Create the swap and be admin of the swap\n    simulation: Option<boolean>, // default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>, // default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n});\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst initializeSwapData: {\n    initializeData: neoTypes.InitializeData; // Data after initializing the swap\n} = await neoSwap.CREATE_INSTRUCTIONS.createInitializeSwapInstructions({\n    clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n    swapInfo: neoTypes.SwapInfo, // Data of the swap\n    signer: PublicKey, // Wallet that will Create the swap and be admin of the swap\n    program: Option<Program>; // If you want to use your own program, import it and pass it here\n\n});\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < initializeSwapData.transactions.length; index++) {\n    const transaction = initializeSwapData.transactions[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Deposit Swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.depositSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet that will deposit in the swap\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst depositTransactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createDepositSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        user: PublicKey, // User that will deposit assets in the swap\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < depositTransactionsWithoutSigners.length; index++) {\n    const transaction = depositTransactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Claim Swap\n\n-   if signer is admin: function validates that all items are deposited (if needed), claims for all users (if needed) and closes the swap unless skipFinalize is set to true\n\n-   if signer is user: function validates that all items are deposited (if needed) and claims for the user unless skipFinalize is set to true where it will claim all the items and close the swap\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst claimAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.claimAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap or User that wish to claim his items\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createClaimSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap or User that wish to claim his items\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: claim all the items and close the swap. If true: only claim the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it here\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Cancel Swap (requires to be admin to finish closing accounts)\n\n-   Cancelling a swap can only be initialized while the swap is in the state TradeStatus.WaitingToDeposit (1)\n\n-   If the signer is the Initializer, it will cancel all remaining items and close the PDA\n\n-   If signer is User, if skipFinalize is set to true , it will cancel his item(s) and change the swap state to TradeStatus.Canceling (100), otherwise, it will cancel all remaining items and close the PDA\n\n-   If outsider wallet tries to cancel a swap, it can only cancel if the swap is in the state TradeStatus.Canceling (100)\n\n### With signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst cancelAndCloseSwapHashes: string[] = // Array of confirmed transaction Hashes\n    await neoSwap.cancelAndCloseSwap({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: Keypair, // Wallet admin of swap OR User that want to cancel his item\n        simulation: Option<boolean>, // OPTIONAL default: skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n        skipConfirmation: Option<boolean>, // OPTIONAL default: iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n    });\n```\n\n### Without signer Keypair\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\n\nconst transactionsWithoutSigners: neoTypes.TxWithSigner[] =\n    await neoSwap.CREATE_INSTRUCTIONS.createCancelSwapInstructions({\n        clusterOrUrl: string, // \"mainnet-beta\" or \"devnet\" or URL\n        swapDataAccount: PublicKey, // PublicKey of the PDA swapDataAccount\n        signer: PublicKey, // Wallet admin of swap OR User that want to cancel his item\n        skipFinalize: Option<boolean>, // OPTIONAL default: false: cancel all the items and close the swap. If true: only cancels the signer items\n        program: Option<Program>, // If you want to use your own program, import it and pass it herw\n    });\n\nconst provider = await getProvider(); //Import your own provider to broadcast transaction to blockchain via the user Wallet\n\nfor (let index = 0; index < transactionsWithoutSigners.length; index++) {\n    const transaction = transactionsWithoutSigners[index].tx;\n\n    const hash = await provider.sendAndConfirm(transaction);\n}\n```\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n## Broadcasting Transaction to blockchain using NeoSwap package and signer\n\n```ts\nimport { neoSwap, neoTypes } from \"@neoswap/solana\";\nimport { Transaction, Keypair } from \"@solana/web3.js\";\n\nconst txsWithoutSigners: neoTypes.TxWithSigner[] = { tx: new Transaction().add(...transactionInstructions) };\n\nconst hashArray: string[] = await neoSwap.UTILS.sendBundledTransactions({\n    clusterOrUrl: string,                       // \"mainnet-beta\" or \"devnet\" or URL\n    signer: Keypair,                            // Keypair of the wallet signing the transaction\n    txsWithoutSigners: neoTypes.TxWithSigner[], // Array of transactions with empty Signer\n    simulation: Option<boolean>,                // OPTIONAL default skip simulation and broadcast to blockchain (recommanded). If true: make simulation of the transactions before broadcasting them\n    skipConfirmation: Option<boolean>,          // OPTIONAL default iterates through the transactions to confirm status (return error if one fails with array of transactionhashes). If true: skip confirmation\n    provider: Option<AnchorProvider>            // OPTIONAL default: undefined. If you want to use your own provider, import it and pass it here\n\n});\n```\n\n## Types section\n\n### Types converter\n\n```ts\n\nlet swapInfo = neoSwap.UTILS.invertedSwapDataConverter({ swapData: SwapData }) \n\nlet swapData = await neoSwap.UTILS.swapDataConverter({ swapInfo: SwapInfo })\n\n```\n\n### Types\n\nswapInfo represents the Data of a swap in a human readable way\n\n```ts\ntype SwapInfo = {\n    status?: \"initializing\" | \"active\" | \"finalizing\" | \"finalized\" | \"canceling\" | \"canceled\";\n    preSeed?: string;\n    currency: string;\n    users: { address: string; items: SwapUserInfo }[];\n};\n```\n\nSwapUserInfo represents the data a user in a swap in a human readable way\n\n```ts\ntype SwapUserInfo = {\n    give: GiveSwapItem[];\n    get: GetSwapItem[];\n    token: { amount: number; status?: string };\n    status?:\n        | \"pending\"\n        | \"partiallyDeposited\"\n        | \"deposited\"\n        | \"partiallyClaimed\"\n        | \"claimed\"\n        | \"partiallyCanceled\"\n        | \"canceled\";\n};\n```\n\nGiveSwapItem and GetSwapItem represents the data of what a user will give or receive and from which user\n\n```ts\ntype GiveSwapItem = {\n    address: string;\n    amount: number;\n    getters: {\n        address: string;\n        amount: number;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n\ntype GetSwapItem = {\n    address: string;\n    amount: number;\n    givers: {\n        amount: number;\n        address: string;\n        status?: \"pending\" | \"deposited\" | \"claimed\" | \"returned\";\n    }[];\n};\n```\n\nSwapIdentity represents the Identity of the swap\n\n```ts\ntype SwapIdentity = {\n    swapDataAccount_publicKey: PublicKey; // PublicKey of the swapDataAccount\n    swapDataAccount_seed: Buffer; // Seed in Buffer format of the Swap\n    swapDataAccount_seedString: string; // Seed in String format of the Swap\n    swapDataAccount_bump: number; // Bump of the PDA\n    swapData: SwapData; // Data of the swapDataAccount\n};\n```\n\nSwapData represents the data of the swap inside the PDA\n\n```ts\ntype SwapData = {\n    initializer: PublicKey;\n    status: number;\n    nbItems: number;\n    preSeed: string;\n    items: Array<NftSwapItem>;\n    acceptedPayement: PublicKey;\n};\n```\n\nNftSwapItem represents the data of one Item in SwapData\n\n```ts\ntype NftSwapItem = {\n    isCompressed: boolean; // true if the item is a compressed NFT (cNFT)\n    isNft: boolean; // true if the item is a NFT\n    mint: PublicKey; // if NFT mint, if cNFT: tokenId, if token: token address, if sol: system program\n    merkleTree: PublicKey; // if cNFT: PublicKey of the merkleTree, else same as mint\n    index: BN; // if cNFT: Index of the item in the merkleTree, else: 0\n    amount: BN; // Amount of the item to be sent\n    owner: PublicKey; // Owner of the item\n    destinary: PublicKey; // Destinary of the item\n    status: number; // Status of the item\n};\n```\n\nInitializeData represents the data after initializing the swap\n\n```ts\ntype InitializeData = {\n    programId: string; // ProgramId of the solana program the swap is being deployed to\n    swapIdentity: neoTypes.SwapIdentity; // Object containing most relevant information of the swap\n    txWithoutSigner: neoTypes.TxWithSigner[]; // Array of transactions to broadcast with empty Signer\n    warning: string; // string containing information that the SwapData contains some NFT that user do not own\n};\n```\n\nTxWithSigner is an array of transaction to be broadcasted using sendAll method from anchor library\n\n```ts\ntype TxWithSigner = { tx: Transaction; signers?: Signer[] };\n```\n\n## Error Type\n\nErrorFeedback represents the feedback thrown when an error is found\n\n```ts\ntype ErrorFeedback = {\n    blockchain: \"solana\";\n    status: \"error\";\n    message: string | unknown;\n    swapStatus?: number;\n};\n```\n\n## Statuses\n\n### Program Swap status\n\n```\nTradeStatus:\n    0 => Initializing\n    1 => WaitingToDeposit\n    2 => WaitingToClaim\n    3 => Closed\n\n    100 => Canceling\n    101 => Canceled\n```\n\n### Program Items status\n\n```\nItemStatus :\n    10 => NFTPending\n    11 => SolPending\n\n    20 => NFTDeposited\n    21 => SolDeposited\n    22 => SolToClaim\n\n    30 => NFTClaimed\n    31 => SolClaimed\n\n    100 => NFTcanceled\n    101 => Solcanceled\n\n    110 => NFTcanceledRecovered\n    111 => SolcanceledRecovered\n```\n\n### UserDataInSwap from UTILS.userSwapDetails\n\n```ts\ntype UserDataInSwap = {\n    userNftToDeposit: NftSwapItem[] | undefined; // Array of NFT the user has to deposit\n    userNftDeposited: NftSwapItem[] | undefined; // Array of NFT the user has deposited\n\n    userNftToReceive: NftSwapItem[] | undefined; // Array of NFT the user has to receive\n    userNftReceived: NftSwapItem[] | undefined; // Array of NFT the user has received\n\n    userNftCancelled: NftSwapItem[] | undefined; // Array of NFT the user has cancelled\n    userSolCancelled: NftSwapItem[] | undefined; // Array of SOL the user has cancelled\n\n    userSolToDeposit: NftSwapItem[] | undefined; // Array of SOL the user has to deposit\n    userSolDeposited: NftSwapItem[] | undefined; // Array of SOL the user has deposited\n    userSolToClaim: NftSwapItem[] | undefined; // Array of SOL the user has to claim\n    userSolClaimed: NftSwapItem[] | undefined; // Array of SOL the user has claimed\n};\n```\n\n### Dummy data\n\n```ts\nlet swapInfo: neoTypes.SwapInfo = {\n    currency: \"usdcPublickey\",\n    preSeed: \"0035\",\n    users: [\n        {\n            address: \"user1Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        getters: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        givers: [{ address: \"user2Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: 50000 },\n            },\n        },\n        {\n            address: \"user2Publickey\",\n            items: {\n                give: [\n                    {\n                        address: \"mint3\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint5\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint4\",\n                        amount: 1,\n                        getters: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                get: [\n                    {\n                        address: \"mint1\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                    {\n                        address: \"mint2\",\n                        amount: 1,\n                        givers: [{ address: \"user1Publickey\", amount: 1 }],\n                    },\n                ],\n                token: { amount: -50000 },\n            },\n        },\n    ],\n};\n```\n\n<!-- MARKDOWN LINKS & IMAGES -->\n\n[neoswap-app]: https://www.neoswap.xyz\n[neoswap-logo2]: https://mma.prnewswire.com/media/2009538/NeoSwap_AI_Logo.jpg?w=200\n[neoswap-logo]: https://neoswap.xyz/static/media/logo.9762f0998529b1eaed83aee714bcb7cd.svg\n","readmeFilename":"README.md"}